Another alternative to killing the connection is to use the slowConsumerStrategy destination policy[1], a consumer that does not ack is considered slow, if this persists for a period, the AbortSlowConsumerStrategy can terminate the consumer and inflight messages will get dispatched.
I think terminating the consumer is the only way to be sure there is no duplicate dispatch. If the consumers remain, you could have a case where each consumer gets a copy of the message, essentially turing a queue into a topic. There was a discussion on this at https://issues.apache.org/jira/browse/AMQ-3394 [1] http://activemq.apache.org/per-destination-policies.html On 4 April 2012 12:41, Gary Tully <[email protected]> wrote: > 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. > > The only way to force the broker to redeliver is to close the consumer. > One way to achieve this is to have the consumers connection timeout if > it is inactive for some period. > > The inactivity monitor, without keepAlive messages will do this for you. > > use a broker url of > <host:port>?useKeepAlive=false&wireFormat.maxInactivityDuration=20000 > > and that will terminate the connection after 20 seconds of inactivity > which will force the broker to redispatch the message. > > > On 4 April 2012 06:51, oBanawalikar <[email protected]> wrote: >> I want to set the timeout period for the Acknowledge i.e. if the acknowledge >> is not received for the particular message from consumer within a time >> period then, the broker should resend the message to the consumer. >> For this purpose should we set the /initialRedeliveryDelay/ field or >> /redeliveryDelay/ field????? >> >> Sorry if the question sounds silly. Its just that the documentation does say >> much about it. >> >> Thanks >> >> -- >> View this message in context: >> http://activemq.2283324.n4.nabble.com/Acknowledgement-Timeout-tp4531016p4531016.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > > > -- > http://fusesource.com > http://blog.garytully.com -- http://fusesource.com http://blog.garytully.com
