Archived

This forum has been archived. Please start a new discussion on GitHub.

Nested call or IceStorm? need some suggestions!!!!

Hi all,

Recently, I'm working on a status monitoring and notify system , with C/S architecture.

First of all, let me brief you some concepts involved in this system, which will help you to understand what I'm talking about, as my English is not good( -_-!!!)

1) Plan : This is a message triggered by external system, it has a list of commands that I call it 'Step'. In another word, a 'Plan' means that something has happened and need someone to excute the commands.

2) Step : As talked above, a 'Step' is a command message which contains a specific client's info, that means this 'Step' need the specific client to finish.

In simple terms,my system will behave like this :

Server A is running on a pc which do the 'Plan' message handling and dispatching job, and some clients(Maximum 10) running on the other PCs connected to Server A .

Once Server A received a ‘Plan’ message triggered from external system, it will do the following things:

1. Server A check the step info and send 'Step' message to the expected client according to the ownership of this 'Step'.
2. Client will send the 'Step' status to server once it changed the status changed (when the client finished/abord the 'Step').
3. Server broadcast the 'Step' status change to every client to notify them the 'Step' status has been changed by someone client.


After reading the ICE documents, I'v got two proposals to construct this system:

1. Using the nested call.

When the clients first connected to the server, it will pass their client proxy to server , on the mean time,the server will store these proxies to a map for later using,
after that, once the server received a plan message or other client's step status change message, it can notify every client by the proxies that stored in the map.

2. Using the icestorm

The server publish a 'Plan' topic on ice-box, the clients subscribe this topic.

Once the server got a 'Plan' message, it will broadcast every 'Step' to all clients through ice-box , each client need to filter the message to discard the messages those client info belongs to other clinets.

After client finished/abord 'Step', it will send the 'Step' status change message back to the server directly, and then server also broadcast this message to all the clients by ice-box.


Advantage of 1:
1. When the server received a Plan message and send step command message to clients, it can deliver the message directly and precisely to the specific client.
2. Less messages exchange between server and clients.

Disadvantages of 1:
1. Server need to maintain the client connections by itself.


Advantage of 2:
1. Server does not need to maintain the clients' connections, ice-box will do that for you. it makes structure more simple.

Disadvantages of 2:
1. Due to the publish/subscribe mechanism, there are much more messages between server and clients at the phase when server received the Plan message and distpaching them to the expected client, and clients need to filter the messages by themself.


That's all I have thought of so far, and I'm not sure of the correctness of my proposal.
Can anyone give me some suggestions or proposal on how to struct this kind of system using ICE ? :confused:

Thanks in advance!!!

Dorian

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Since you need one-to-one communication between the server and the client it's probably best to go with your first suggested solution: the server maintains a list of connected clients and only send the "plan" to the appropriate client directly. You might want to look into using sessions as well for managing this list of clients in the server. See the demo/Ice/session provided with your Ice distribution for an example.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    Since you need one-to-one communication between the server and the client it's probably best to go with your first suggested solution: the server maintains a list of connected clients and only send the "plan" to the appropriate client directly. You might want to look into using sessions as well for managing this list of clients in the server. See the demo/Ice/session provided with your Ice distribution for an example.

    Cheers,
    Benoit.

    Hi Benoit,

    Thanks for your answers.

    As I described in my post, there are two kinds of communication here.

    1. one-to-one communication : When the Server got a 'Plan' message and dispatch the 'Step' messages contained in the 'Plan' message to the expected client. Also, when a client finished/abort a 'Step', it send back a status message to server.

    2. one-to-N communication : When the Server received a client's 'Step' status change message, it need to broadcast to all client to notify them to update the 'Step' status, because every client need to monitor every 'Step' status change, even the 'Step' is expected to finish by other client.

    So, when the server go throgh the second situation, should I broadcast to all client one by one by using the proxies in server? Or shoud I just use IceStorm here. I mean, maybe I should use nested call(or sessions) when go with the 1 situation, and use IceStorm when go with 2?

    Thanks again for your kind reply!

    Dorian