Spring DefaultMessageListenerContainer (DMLC) has concurrentConsumer and taskExecutor . The taskExecutor bean can be set to the corePoolSize property. What is the difference between specifying concurrentConsumer and corePoolSize? When the concurrentConsumer property is defined, this means that Spring will create the specified number of users / message handlers to process the message. When does a corePoolSize image enter an image?
Code snippet
<bean id="myMessageListener" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory" /> <property name="destination" ref="myQueue" /> <property name="messageListener" ref="myListener" /> <property name="cacheLevelName" value="CACHE_CONSUMER"/> <property name="maxConcurrentConsumers" value="10"/> <property name="concurrentConsumers" value="3"/> <property name="taskExecutor" ref="myTaskExecutor"/> </bean> <bean id="myTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" > <property name="corePoolSize" value="100"/> <property name="maxPoolSize" value="100"/> <property name="keepAliveSeconds" value="30"/> <property name="threadNamePrefix" value="myTaskExecutor"/> </bean>
spring spring-jms
Gaurav
source share