[zeromq-dev] Bidirectional Comminication between equal nodes

BELLUS Stefan Stefan.Bellus at frequentis.com
Mon Jul 18 09:35:45 CEST 2011

Hi Martin

Big thank for your support.
I have to study more deeply your guide. Up to now I read chapter 3 and 4. I found out in chapter 3 that there is router dealer example
There are 2 things that are interesting for me.
1. Asynchronous Client-Server
    Clients connect to the server and send requests.
    For each request, the server sends 0 to N replies.
    Clients can send multiple requests without waiting for a reply.
    Servers can send multiple replies without waiting for new requests.
2. Address-based Routing
    The client has a message that it expects to route back (via another router) to some node. The message has two addresses (a stack), an empty part, and a body.
    The client passes that to the router but specifies a papa address first.
    The router removes the papa address, uses that to decide which papa to send the message to.
    The papa receives the addresses, empty part, and body.
    It removes the addresses, saves them, and passes the body to the worker.
    The worker sends a reply back to the papa.
    The papa recreates the envelope stack and sends that back with the worker's reply to the router.
    The router prepends the papa's address and provides that to the client along with the rest of the address stack, empty part, and the body.

1) ISDN ----- CallRequest --> Node1 -----Some converted message (In this case request) ---> Node2 ---- INVITE ---------> Sip
2) ISDN <---- Progress ------ Node1 <----Some converted message (In this case reply) ------ Node2 <--- Proceed --------- Sip
3) ISDN <---- Alert --------- Node1 <----Some converted message --------------------------- Node2 <--- Alert ----------- Sip        
4) ISDN <---- Answer -------- Node1 <----Some converted message --------------------------- Node2 <--- Connect --------- Sip        
5) ISDN <---- Release ------- Node1 <----Some converted message (In this case request) ---- Node2 <--- Disconnect ----- Sip        
6) ISDN ----- ReleaseAck----- Node1 -----Some converted message (In this case reply) -----> Node2 ---- Disconect Ack --> Sip

I will try figure out how use " Asynchronous Client-Server " and " Address-based Routing " for my needs.
Is it good way to use this patterns?


-----Original Message-----
From: Martin Sustrik [mailto:sustrik at 250bpm.com] 
Sent: Sunday, July 17, 2011 8:06 AM
To: ZeroMQ development list
Cc: BELLUS Stefan
Subject: Re: [zeromq-dev] Bidirectional Comminication between equal nodes

Hi Stefan,

> 1,2) Node1 sends request and needs reply from Node2
> 3,4) Node2 sends message to node Node2, it doesn't need reply
> 5,6) Node2 sends request and needs reply from Node1

It sounds like there are two topologies involved, one being req/rep, other one being probably pub/sub (judging on "alert" command).


More information about the zeromq-dev mailing list