activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: Stop and resume message consuming
Date Mon, 12 Aug 2013 14:16:20 GMT
Take a look here:

https://gist.github.com/christian-posta/6211175

Key is to use prefetch == 1 and   factory.setAlwaysSessionAsync(true) on
the consumer.

Cheers,
Christian






On Mon, Aug 12, 2013 at 5:20 AM, retok <reto.krebs@profidatagroup.com>wrote:

> JmsTest.zip <
> http://activemq.2283324.n4.nabble.com/file/n4670280/JmsTest.zip>
>
> I attached an example with a simple broker service, a producer and a
> consumer.
> The producer simply sends 30 messages and the consumer does not acknowledge
> every 3rd message.
>
> The effect is, that the first time, message 1 and 2 get acked as expected.
> Message 3 does not get acked as expected. But message 4 also gets through
> and gets acked --> This should not happen.
> I observed, that it only happens the first time after starting the test
> apps, so after message 6, 9, 12, etc. it does not happen anymore.
>
> I also observed, that I can prevent this from happening the first time,
> when
> I stop() the consumer when a message is not acked and start() the consumer
> after recovery (lines 72 and 101 in my example TestJmsConsumer.java). Might
> this be the solution?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Stop-and-resume-message-consuming-tp4670118p4670280.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message