title: Optimizing JMS listeners in Spring
body: <p>I've got a queue in ActiveMQ. There are 2 consumers using 2 different selectors. The problem is that messages are produced much faster that being consumed.</p>
  
  <p>I'm using Spring Boot ActiveMQ starter with the default configuration with <code>DefaultMessageListenerContainer</code>. The only thing I've found for tuning it so far is <code>DefaultMessageListenerContainerFactory.setConcurrency</code>. Currently it is set to <code>2-4</code> but increasing it even to <code>10-50</code> still doesn't resolve the problem though performing somewhat better.</p>
  
  <p>I wonder what are the best practices of configuring JMS listeners in Spring? How can I tune its performance?</p>
  
  <p>Thank you very much in advance!</p>