Have the heartbeat reply include a guid which represents the instance of the 
server, the server picks a guid at startup and always uses it. If the client 
sees two different guids then it knows the server restarted and can take 
action. The server side state is minimal, the client needs to track the guids 
it gets back on a per server basis.


On Mar 23, 2015, at 9:39 AM, Russell Della Rosa 
<[email protected]<mailto:[email protected]>> wrote:

I'm doing this using JeroMq (may use jzmq at some point) so I'm at the mercy of 
the JVM.

I have a wrapper around the JVM that heartbeats also, it and will kill the JVM 
if it doesn't reply with a pong.  After the wrapper kills the JVM, it will 
quickly restart the JVM so I'm not sure there is a good point to send this 
shutdown message.  (The wrapper might be able to but I think that might get 
complex.)

I like this idea though since it keeps the server stateless.

________________________________
From: Justin Karneges <[email protected]<mailto:[email protected]>>
To: [email protected]<mailto:[email protected]>
Sent: Friday, March 20, 2015 2:41 PM
Subject: Re: [zeromq-dev] Ping Pong Heartbeats & Quick Server Restart Issue

> I'm curious if anyone has solved this quick server restart problem in a
> clean way with socket patterns?  Or if you have other suggestions?  Or if
> you have example code of ping/pong handling this case I'd love to see it.

I suggest having the server send some kind of shutdown message. This is
basically the same as how regular TCP connection loss is indicated,
except that you have to do it yourself rather than the OS doing it for



you.


Of course, the advantage of the OS doing it for you is that you can
ensure a close packet is sent even if your process crashes. This may bit
a bit harder to do with ZeroMQ, depending on the language.
_______________________________________________
zeromq-dev mailing list
[email protected]<mailto:[email protected]>
http://lists.zeromq.org/mailman/listinfo/zeromq-dev<https://urldefense.proofpoint.com/v1/url?u=http://lists.zeromq.org/mailman/listinfo/zeromq-dev&k=8F5TVnBDKF32UabxXsxZiA%3D%3D%0A&r=3Cz4BWxkuioYQ%2BdxY62EqptPwDeTj3M%2B5v06yEnFWTY%3D%0A&m=7MAl5btFQ60vHCXT9uKH65obPguN3ihVUEVTNwTJvzY%3D%0A&s=caf963151a45847acc3cf01940a6b42b97590128726ebbf7e0ef3af7f0b78330>



_______________________________________________
zeromq-dev mailing list
[email protected]<mailto:[email protected]>
https://urldefense.proofpoint.com/v1/url?u=http://lists.zeromq.org/mailman/listinfo/zeromq-dev&k=8F5TVnBDKF32UabxXsxZiA%3D%3D%0A&r=3Cz4BWxkuioYQ%2BdxY62EqptPwDeTj3M%2B5v06yEnFWTY%3D%0A&m=7MAl5btFQ60vHCXT9uKH65obPguN3ihVUEVTNwTJvzY%3D%0A&s=caf963151a45847acc3cf01940a6b42b97590128726ebbf7e0ef3af7f0b78330


----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any 
disclosure, copying, or further distribution of confidential information is not 
permitted unless such privilege is explicitly granted in writing by Quantum. 
Quantum reserves the right to have electronic communications, including email 
and attachments, sent across its networks filtered through anti virus and spam 
software programs and retain such messages in order to comply with applicable 
data security and retention requirements. Quantum is not responsible for the 
proper and complete transmission of the substance of this communication or for 
any delay in its receipt.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to