How would I implement a distributed Remote Method Invocation system?
I'm trying to create something like the following:
var result = remoteHost.MyMethod(5);
I've tried using RMI libraries like SuperPool and Scs, however they have a few fundamental issues:
The difference would be that any component on clients can also communicate with components on other clients, as opposed to only client-->server or server-->client communication.
How would you suggest I implement this (perhaps using these existing solutions as a base), or is there some other existing solution that might work?
Here is a diagram of what I'm trying to do:
IMPORTANT NOTE: Clients do NOT connect to each other.
Process:
The idea is the same as what SuperPool has done, except allowing the Client --> Server --> Client communication path for invoking a method on the second client.
Although ZeroMQ is quite low level, it supports bidirectional communication and has .NET support and is available on nuget.org
You can multiplex many bidirectional conversations on a DEALER/ROUTER or DEALER/DEALER socket pair and either side can initiate a conversation.
Be aware though that ZeroMQ does not come with everything ready to do method invocation; you would have to create your own protocol or use an existing one and implement it.
Both Salt and Cloudless, built on top of ZeroMQ, provide remote method invocation.
ZeroMQ facilitates very robust asynchronous sockets (and more) Routing messages is absolutly possible. If you combine the Ventilator and Sink in the ZeroMQ Guide you are very close to what you want to accomplish.
Note that you would still have to implement the actual protocol and method invocation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With