wasmCloud / interfaces

Deprecated: wasmCloud API interfaces: smithy IDLs and shared libraries
https://wasmcloud.github.io/interfaces/
Apache License 2.0
34 stars 22 forks source link

RFC - Messaging Interface Update to allow A2A Requests #108

Closed andar1an closed 1 year ago

andar1an commented 1 year ago

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

autodidaddict commented 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.

autodidaddict commented 1 year ago

Our pet clinic example (https://github.com/wasmCloud/examples/tree/main/petclinic) shows how to make actor to actor calls

andar1an commented 1 year ago

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.

autodidaddict commented 1 year ago

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.

autodidaddict commented 1 year ago

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

andar1an commented 1 year ago

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.

andar1an commented 1 year ago

Dumb question, I think the purpose is so the interface can conform to a strict format. I will close this.

autodidaddict commented 1 year ago

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.

andar1an commented 1 year ago

@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?

andar1an commented 1 year ago

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