[zeromq-dev] ROUTER-DEALER missing connects/messages.
Dowd, Brian
Brian.Dowd at commerzbank.com
Tue Sep 25 17:05:14 CEST 2012
HI Michel,
Yes it is a multi-part message on the send side, however the first part is just the identity/destination/address details
(i.e. client-1/client-2 etc), and the setIdentity() call in the "Client" side of things associates thw two so that when the
"client-1" is set in the first part the ZMQ layer knows to send that message to the "Client" that connected with identity
"client-1" .... Also, just in case I did double check the rtdealer.c and it behaves exactly equivalently in that it does not
loop as you suggest, but does it the same way as my java example more or less, I imagine looping woudl make sense
when you are not using ROUTER/DEALER and do not know in advance how many parts there are ...
I dont believe it is the issue here.
Cheers,
Brian
-----Original Message-----
From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Michel Pelletier
Sent: 25 September 2012 15:36
To: ZeroMQ development list
Subject: Re: [zeromq-dev] ROUTER-DEALER missing connects/messages.
It looks like you are sending a multi-part message but not receiving it correctly. I'm not java expert so perhaps I could be wrong about how to recv a multi-part message in java, but in C you need to loop on
recv() and check the socket option ZMQ_RCVMORE to know when to break.
-Michel
On Tue, Sep 25, 2012 at 6:51 AM, Dowd, Brian <Brian.Dowd at commerzbank.com> wrote:
> Hi all,
>
> I am trying to get a simple example ROUTER/DEALER working, but seem
> to be hitting a problem
>
> that I've seen referred to in a few places - basically that of
> los/missing messages.
>
>
>
> I need my clients (DEALERs) and server (ROUTER) to be able to stop &
> start independently .. they will be
>
> in separate processes.
>
>
>
> My ROUTER will be the server and there will be multiple DEALER-clients
> however I cannot do the Thread.sleep()
>
> that appears in the rtdealer example in my real production code.
>
>
>
> I've seen some traffic about it and tried some suggestions in my code
> -
>
> 1. Thread.sleep() - from original rtdealer, works but not
> deterministically and cannot use in PROD.
>
> 2. Send a message through on each side to complete the connection,
> does not fully work.
>
>
>
> I've also seen some issues about it in the newsgroups, and am
> wondering if this is an issue with the
>
> later versions of zero mq... I don't know.
>
>
>
> http://article.gmane.org/gmane.network.zeromq.devel/13004
>
> http://thread.gmane.org/gmane.network.zeromq.devel/12967/focus=12982
>
> http://thread.gmane.org/gmane.network.zeromq.devel/11571
>
> http://article.gmane.org/gmane.network.zeromq.devel/12981/match=router
> +dealer
>
>
>
> I also could not see a JIRA issue reported against exactly this
> behaviour, so perhaps I am doing something silly ....
>
>
>
> I am using java version 1.6.0-21 and ZMQ version version 3.2.0-rc1 as
> recommended for new projects.
>
> The OS is Windows x86 architecture.
>
>
>
> I have also run (not the example) a more comprehensive version on
> linux boxes, and they seem to work
>
> sometimes and not others (timing related) I believe it is the same
> problem that the example code illustrates,
>
> this is on i386/Linux.
>
>
>
> Here is a paste bin of my example code - http://pastebin.com/s1gJpcP9
>
>
>
> Any help very much appreciated.
>
>
>
> Cheers,
>
> Brian.
>
>
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list