ZeroMQ XREP -- Endpoint disappearing -


i using standard lru queue defined zeromq guide figure 41, , wondering how add in protection don't send messages end points have disappeared (server crash, oom killer, along lines).

from documentation read xrep drop message if going non-existant end-point, , there no way notified that. there way such notification? should send out "ping" first , if don't response "worker" dead meat me? how know same client sent ping getting message from?

or use case not 1 zeromq? want make sure message has been received, don't want being dropped on floor without knowledge...

pinging worker know if alive cause race condition: worker might answer ping before dies.

however, if assume worker not die during request processing (you can little in case), can reverse flow of communication between workers , central queue. let worker fetch request queue (using req/rep connection) , have send answer along original envelope when processing done (using same socket above, or better through separate push/pull connection).

with scenario, know dead worker not sent requests, unable fetch them (being dead…). moreover, central queue can ensure receives answer every request in given time. if not, can put request in queue new worker fetch shortly after. way, if worker dies while processing request, request served.

(as side note: careful if worker crashes because of particular request - not want kill workers 1 one, , might want put maximum number of tries request)

edit: wrote some code implementing the other direction explain mean.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -