Your problem is you are always creating a new consumer in your consume()
method but never closing it.  So the consumer is sticking around and
hanging onto messages in prefetch.  You either need to reuse your message
consumer (call receive() on the same open consumer after rollback because
it's getting the message again in prefetch) or close it and use a different
consumer.  You might also be able to set prefetch to 0 to get it to work.

I took your code and modified it both ways to show each strategy:

https://gist.github.com/cshannon/45d573fabeba733c6bb6
https://gist.github.com/cshannon/64b8f790f9b57269ae45

On Fri, Sep 11, 2015 at 7:14 PM, Kevin Burton <bur...@spinn3r.com> wrote:

> OK.
>
> For the life of me I can’t get this to work.
>
> https://gist.github.com/burtonator/eb7a70e1750080ca621e
>
> Basically I want to call rollback() so that a message is retries later.
> This way if there’s a transient but like a database connection failing it
> gets retried (but of course uses the retry policy).
>
> The problem is that it just doesn’t work.
>
> I tried creating too ‘clients’ whereby each has its own client ID.  That
> doesn’t work either.
>
> I went through the tests in ActiveMQ and didn’t see anything obvious
> there.  I must be missing something super obvious….
>
> Any thoughts?
>
> --
>
> Founder/CEO Spinn3r.com
> Location: *San Francisco, CA*
> blog: http://burtonator.wordpress.com
> … or check out my Google+ profile
> <https://plus.google.com/102718274791889610666/posts>
>

Reply via email to