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]>
To: [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]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev