5

Original Post

How would I implement a distributed Remote Method Invocation system?

I'm trying to create something like the following:

  • Master Server to track individual "hosts".
  • Hosts can communicate with other hosts on the network using a proxy-object-interface based programming style, example: var result = remoteHost.MyMethod(5);

I've tried using RMI libraries like SuperPool and Scs, however they have a few fundamental issues:

  • SCS Supports only Server --> Client or Client --> Server communication, no Client --> Client communication.
  • As far as I can tell, SuperPool only supports the same, although this picture would suggest otherwise, I cannot find anything in the documentation on how to do this: enter image description here

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?

More Extensive Example

Here is a diagram of what I'm trying to do: enter image description here

IMPORTANT NOTE: Clients do NOT connect to each other.

Process:

  1. Client1 connects to Server
  2. Client2 connects to Server
  3. Client1 invokes a method on Client2, without knowing if the component of Client2 exists on the Server, another Client, or itself.

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.

3
  • I can't say that I'm giving an answer, but portions of cslanet.com may give you ideas and even some plumbing Commented May 12, 2013 at 3:05
  • @G.Stoynev Cool, still trying to figure out what it does, but will have a look! Commented May 12, 2013 at 5:42
  • I encountered CSLA by reading author's "Business Objects" book in its early editions. Where I think it might help you is with ideas about layering your app (design and implementation) and the operational tiers that are targeted by your requirements. Commented May 12, 2013 at 18:25

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

8 Comments

The question is not about bidirectional communication, rather it is about managing this sort of communication over numerous hosts, all connected to one central "hub"
What do you mean by "managing this sort of communication over numerous hosts"? You can have dealers and routers in ZeroMQ.
I apologize, I'll look into it some more.
No problem, I am also not sure whether or not I understand the problem you have.
I have clarified my question in the OP, please have a look again and let me know if ZeroMQ can do this
|
0

From a cursory look at Superpool it does seem to support all possible types communications. It is an RMI layer over a message queue, and allows synchronous or asynchronous communication to a named target or (possibly multiple) unnamed targets. I confess to not really understanding what your architecture is about.

The problem I see with Superpool is that it locks you in to .Net. All your components must be .Net and all must use Superpool.

The "standard" way to deal with decoupled communications between components (decoupled meaning the sender does not necessarily need to know who the receiver is), is to place all the components on a message bus. @Erno de Weerd propossed ZeroMQ which is one possible way to do this, a higher level option (albeit slower) is to use a full fledged message queue server(s) such as RabbitMQ or even MSMQ.

The downside is you lose the invocation syntax of Superpool (or other RMI solutions) and must think of passing messages back and forth through channels instead of calling methods on components.

3 Comments

I like SuperPool's implementation, however the real issue is that, although there is decoupled communication, the only "clients" or components visible to each client are the ones to which you are directly connected. There is no routing between client --> server --> client. Thank you for the link to the other MQ options. I'll continue to research this.
What do you mean by directly connected? Routing should be the headache of the communication network.
I mean, clients are only connected to the server, not other clients. SuperPool only allows access to clients that you are connected to - as far as I know it's not possible to have a pool that encircles the server and a couple clients

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.