InitialContext ctx = new InitialContext();
QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(QUEUE_FACTORY);
QueueConnection queConn = factory.createQueueConnection();
Queue queueA = (Queue) ctx.lookup("queue/A");
Queue queueB = (Queue) ctx.lookup("queue/B");
queConn.start();
MDBInvoker[] threads = new MDBInvoker[MAX_SIZE];
for(int n = 0; n < MAX_SIZE; n ++)
{
// Each thread should own its own session, accordingly to the JMS spec
QueueSession session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);