Closed andar1an closed 1 year ago
Actors can make calls to actors without the need for a messaging interface. Actor-to-actor calls can use any interface and wasmCloud supports native RPC between actors out of the box.
Our pet clinic example (https://github.com/wasmCloud/examples/tree/main/petclinic) shows how to make actor to actor calls
I have had errors with this in the past where it failed. I can try again, but to do this I have had to make my own interface. Maybe I was doing something wrong, but I do recall there being an issue with this.
That's correct. For an actor to call an actor, you need to define the interface that will be used by those actors. The receiving actor will implement the actorReceive
part of the interface, which will be callable from the calling/client actor.
We have plans to do a documentation update that will clearly outline how to do actor-to-actor calls, but this is what we have now: https://wasmcloud.com/docs/app-dev/a2a/#using-the-actor-core-api
Thanks, @autodidaddict. I was wondering with this PR if it would be possible to just enable using the Messaging Interface instead. I am already doing A2A calls with my own interface as seen here in apigw example I am working on: https://github.com/wasmCloud/examples/pull/205 . However, it makes it hard when working on examples unless it would be preferable to just include an interface with examples. But I am wondering why not just include what you need as JSON blob via messaging interface instead.
Dumb question, I think the purpose is so the interface can conform to a strict format. I will close this.
The messaging interface (much like its wasi-messaging counterpart) is designed to connect an actor to an abstract message broker. The messaging interface is designed for general purpose request/response/publish/subscribe operations.
You can have two actors communicate with each other over the messaging interface, but you need both of them linked to the messaging interface and configured to allow one to subscribe to a given topic, etc. But if you want just raw a2a RPC, then you can bypass the messaging interface.
@autodidaddict Only reference I see for wasi-messaging is here: https://github.com/wasmCloud/wasmCloud/pull/286/, and it seems this is blocked by another pr so it is closed for now. Is there somewhere else I can see what is happening with that?
Assuming you meant this: https://github.com/WebAssembly/wasi-messaging I will stick to how I am doing things for now until I can learn more. Thanks for feedback
Feature or Problem
Can we update the messaging interface to allow Actors to make RPC requests to other actors. An example use-case could be apigw.
Looking to set actorReceive: true in Messaging service if this is the appropriate means to enable a2a requests using the messaging provider.
It may replace the need for a2a custom interfaces like this: https://github.com/wasmCloud/examples/blob/db91ef9eba1a782457b8d7f89fd73c9f32056a5b/actor/apigw/jammin_interfaces_apigw/apigw.smithy
Related Issues
Release Information
Consumer Impact
Testing
Built on platform(s)
Tested on platform(s)
Unit Test(s)
Acceptance or Integration
Manual Verification