I am new to jms. The goal is to process messages concurrently from a queue in an asynchronous listener\'s onMessage method by attaching a listener instance to multiple consume
I only took a brief look and I noticed that you pass the wrong consumer to your second thread:
Thread newThread2 = new Thread(consumer1); // has to pass consumer2
beside of this, some variables such as ConnectionFactory
are static and initialized multiple times/overriden. You only need one connection that could create multiple sessions and/or consumers.