Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the timeout for a message in ActiveMQ broker?

I want to set the timeout period for the Acknowledge i.e. if the acknowledge is not received by the broker for the particular message from consumer within a time period then, the broker should resend the message to the consumer. Is it possible to set such settings in the broker???

like image 920
omkar Avatar asked Apr 11 '12 05:04

omkar


1 Answers

Here are a couple links that explain how to solve this problem with ActiveMQ 5.9:

  • https://issues.apache.org/jira/browse/AMQ-3394
  • https://planet.jboss.org/post/coming_in_activemq_5_9_a_new_way_to_abort_slow_consumers

To summarize:

  • if the consumer JVM dies, the JMS connection between broker and consumer will timeout, and any unacknowledged message will be re-scheduled for delivery
  • if the JMS connection doesn't die but the consumer is stuck processing a message, AbortSlowAckConsumerStrategy will abort slow consumers when they reach the configured threshold of slowness, default is that a consumer that has not Ack'd a message for 30 seconds is slow
like image 188
Guillaume Carre Avatar answered Sep 27 '22 19:09

Guillaume Carre