You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Michel Jung <mi...@gmail.com> on 2021/01/29 06:04:14 UTC

When are consumers created/removed?

Hi,

I have 3 queues, 1 consumer per queue and a default prefetch size of 1. The
way I understand it, the broker should push to the consumers rather than
the consumers pulling.

Yet, I see that, every second, each consumer is removed and immediately
re-added.

Is this expected? How can I avoid this?

Kind regards
Michel

Re: When are consumers created/removed?

Posted by Matt Pavlovich <ma...@gmail.com>.
Spring Template is causing the consumer and session object to close— its how its designed. Try CACHE_CONSUMER or if you can avoid using Spring JMS Template altogether. 

For certain— every Spring JMS Template user should use connection pooling to help mitigate the object thrashing.

YMMV— a significant number of our support and perf issues reported to us on ActiveMQ are root caused by Spring JMS Template on the consumer side and frameworks that use it (camel-jms). Spring JMS Template suffers from high latency and prevents the performance benefits of caching and prefetch from being realized.

-Matt Pavlovich

> On Jan 29, 2021, at 12:11 AM, Michel Jung <mi...@gmail.com> wrote:
> 
> I should have mentioned that I'm using Spring Integration's
> DefaultMessageListenerContainer with cacheLevel set to CACHE_CONNECTION.
> 
> On Fri, 29 Jan 2021, 07:04 Michel Jung, <mi...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I have 3 queues, 1 consumer per queue and a default prefetch size of 1.
>> The way I understand it, the broker should push to the consumers rather
>> than the consumers pulling.
>> 
>> Yet, I see that, every second, each consumer is removed and immediately
>> re-added.
>> 
>> Is this expected? How can I avoid this?
>> 
>> Kind regards
>> Michel
>> 


Re: When are consumers created/removed?

Posted by Michel Jung <mi...@gmail.com>.
I should have mentioned that I'm using Spring Integration's
DefaultMessageListenerContainer with cacheLevel set to CACHE_CONNECTION.

On Fri, 29 Jan 2021, 07:04 Michel Jung, <mi...@gmail.com> wrote:

> Hi,
>
> I have 3 queues, 1 consumer per queue and a default prefetch size of 1.
> The way I understand it, the broker should push to the consumers rather
> than the consumers pulling.
>
> Yet, I see that, every second, each consumer is removed and immediately
> re-added.
>
> Is this expected? How can I avoid this?
>
> Kind regards
> Michel
>