Waiting to return from onMessage() till its work is completed on the other thread sounds like it should give you what you want. On Jun 23, 2015 3:53 PM, "Kevin Burton" <[email protected]> wrote:
> > If you want to pause message acknowledgement and wait before consuming > more > > messages then you should probably use a synchronous consumer instead and > > just call "consumer.receive()" and not try and use a messageListener > which > > is asynchronous. > > > > I have to move away from synchronous because we require so many threads > that even a prefetch of 1 means that our robot has 20-40k of message > waiting to be processed. It’s definitely a weird use case, I’ll admit. > > But it sounds like, as long as I don’t return from onMessage(), then no > more messages will be processed. Perhaps I can just submit it to a queue > and then call await() on a count down latch before continuing forward. > > -- > > 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> >
