I want to concurrently listen the messages(Plenty of messages) from Queue
using Spring's DefaultMessageListenerContainer
.
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="destinationName" ref="queue"/>
<property name="messageListener" ref="myMessageListener"/>
<property name ="concurrentConsumers" value ="10"/>
<property name ="maxConcurrentConsumers" value ="10000"/>
</bean>
I read from the spring_Forum that max 5 to 10 concurrentConsumers can be specified in concurrentConsumers and maxConcurrentConsumers. .
Question 1 :
I want to read too many messages as fast as possible.
Can it be possible by increasing the concurrentConsumers
& maxConcurrentConsumers
to 10 thousand or more than that?
Question 2:
Please suggest any other way If it is not efficient way for the too many messages?
Assuming,
Threads
(Equal to maxConcurrentConsumers
) running in system is going to start thrashing as it madly context switches between all the running processes (Threads
).