Question: Multipledealers 1 router

57 views
Skip to first unread message

Rik Svendsen Rose

unread,
Jan 23, 2019, 6:48:44 AM1/23/19
to netmq-dev
Hi

I have a system with multiple mobile devices. The devices may, or may not be online.
It seams like i can use the Router/Dealer pattern in netMq/ZeroMQ to support muliple (hundreds) of dealers and 1 router.

Then the router can be used to "publish" messages to specific clients. i.e. only the clients that need a defined message.


If The Dealer sends a frame from a connecting device using "SendFrame" i can make the Router accept mesages from one or more dealers.
I can use this frame as a "Hey, i am online, send me my stuff" message. and use the client id for many messages after...


But is this a bad idea?`Ie. mutipler dealers, 1 router? I know i could use topics in publish, but the dealer / router is on sent to the clientid, hence i expect saving data transfer. I.e. the publish messages uses data on all devices, but the router/dealser sends to thed specific sockets that a dealer is on...


Thanks, Any advice would be super..!

BR Rik

Doron Somech

unread,
Jan 23, 2019, 9:30:44 AM1/23/19
to Rik Svendsen Rose, netmq-dev
That a valid solution.
Let me suggest a protocol:
- The user sends CONNECTION-OPEN message with identifying data.
- The router sends back a CONNECTION-ACK and associates the identity with the user information.
- The router now pushes relevant information to the client.
- You can set Options.Mandatory to true, this will through an exception if the client is disconnected, so you can know when a client is down.
- You can also use heartbeat from client to server, the user will send a PING message and the router will respond with PONG. If router doesn't receive a PING for a certain time period, it will remove the identity and user information in order to stop sending messages to the user identity.
- Finally, it the router receive a message from unknown identity, it should reply with ERROR message. When the user receives an ERROR message he will send the CONNECTION-OPEN again. This is important in order to recover from disconnections.

--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+...@googlegroups.com.
To post to this group, send email to netm...@googlegroups.com.
Visit this group at https://groups.google.com/group/netmq-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages