Thursday, 15 March 2012

Setting a long timeout for RabbitMQ ack message -



Setting a long timeout for RabbitMQ ack message -

i wondering if possible. want pull task queue , have work potentially take anywhere 3 seconds or longer (possibly) minutes before ack sent rabbitmq notifying work has been completed. work done user, hence why time takes process job varies.

i don't want ack message after pop off queue because want message requeued if no ack received. can give me insights how solve problem?

having long timeout should fine, , want redelivery if goes wrong, want ack after finish.

the best way accomplish that, imo, have multiple consumers on queue (i.e. multiple threads/processes consuming same queue). should fine long there's no particular ordering constraint on queue contents (i.e. way there might if queue contain contents representing postgres info involves fk constraints).

this tutorial on rabbitmq website provides more info (python linked, there should similar tutorials other languages): https://www.rabbitmq.com/tutorials/tutorial-two-python.html

edit in response comment op:

what's heartbeat set to? if worker doesn't acknowledge heartbeat within set period of time, server consider connection dead.

not sure language you're using, java utilize setrequestedheartbeat method specify heartbeat.

the way implement workers, it's vital heartbeat can still sent rabbitmq server. if blocks client sending heartbeat, server kill connection after time interval expires.

rabbitmq message-queue bunny

No comments:

Post a Comment