Search the VMware Knowledge Base (KB)
View by Article ID

Listener defined in DefaultMessageListener is not scaling even when a taskExecutor is defined (2007016)

  • 0 Ratings


  • Listener defined in DefaultMessageListener is not scaling
  • This issue occurs even when a taskExecutor is defined


If you scale your tasks by defining a taskExecutor in your defaultMessageListener, you may have this spring configuration:

Note: You may notice that your active count and size in your taskExecutor is not increasing even though you have a lot of requests.

<bean id="myDefaultMessageListener" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="taskListenerConnectionPool" />
<property name="messageListener" ref="myTaskListener" />
<property name="taskExecutor" ref="myTaskExecutor" />

<!-- this bean contains your onMessage Method -->

<bean id="myTaskListener" class="com.listener.MessageListener"/>

<bean id="myTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="1"/>
<property name="maxPoolSize" value="45"/>

The corePoolSize indicates the core number of threads. Try raising your corePoolSize higher than 1 so that tasks run serially.
If the core number of threads are busy or unavailable tasks are queued up, the default queue capacity of the ThreadPoolExecutor is set up to Integer.MAX_Value. If the queueCapacity is reached, additional threads are created until it reaches MaxPoolSize.
Tasks are not scaling up because the queue capacity is big. If you do not want messages to queue up, lower the queue capacity. You might want also set the allowCoreThreadTimeOut to true, which means that it will scale up until corePoolSize but also scale down if no tasks come in. 
Note: The settings discussed in this article are for listeners that consume on queues only.

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.


  • 0 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)

Please enter the Captcha code before clicking Submit.
  • 0 Ratings