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???
Set the timeout for a message in ActiveMQ broker?
Asked Answered
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
see http://activemq.2283324.n4.nabble.com/Acknowledgement-Timeout-td4531016.html
There is no support for this with the redelivery policy. jms is connection oriented, so the assumption is that if the connection is alive and there is no ack, the consumer has a good reason not to ack yet.
© 2022 - 2024 — McMap. All rights reserved.