Multi client RPC

589 views Asked by At

I have a router, a server and multiple clients. The server registers methods in the router, and the clients successfully call the methods and get the result. In some cases, I need the server to ask a specific client something. I already have the sessionId using WampInvocationContext.Current.InvocationDetails, but I have no idea how the clients need to register their methods, nor do I know how to call them from the server.

I looked in the documentation, but had no luck. Does wamp-proto actually support such a thing? If so, got any pointers?

1

There are 1 answers

0
gzost On BEST ANSWER

If I understand correctly, you want multiple clients to register the same procedure, and then call specific ones among them.

This is not possible with WAMP using the same URI for the procedure.

For what you want to do, the intended way is to use URIs which contain a client ID, e.g. if your procedure is "com.example.calculate_load", clients would register "com.example.client_1.calculate_load" (or "com.example.calculate_load.client_1"), and you'd address the clients via the procedure URI.

It is possible for multiple clients to register the same procedure under the same URI, but this is intended for scaling out procedures or for having hot stand-bys. The router decides which client to call, based on a common strategy under which the clients registered (e.g. round-robin). See http://crossbar.io/docs/Shared-Registrations/