conn.start();
tm.begin();
//Create 2 sessions and enlist them
XASession sess1 = conn.createXASession();
XAResource res1 = sess1.getXAResource();
XASession sess2 = conn.createXASession();
XAResource res2 = sess2.getXAResource();
Transaction tx = tm.getTransaction();
tx.enlistResource(res1);
tx.enlistResource(res2);
//Receive the messages, one on each consumer
MessageConsumer cons1 = sess1.createConsumer(queue);
TextMessage r1 = (TextMessage)cons1.receive(MAX_TIMEOUT);
assertNotNull(r1);
assertEquals("jellyfish1", r1.getText());
cons1.close();
MessageConsumer cons2 = sess2.createConsumer(queue);
TextMessage r2 = (TextMessage)cons2.receive(MAX_TIMEOUT);
assertNotNull(r2);
assertEquals("jellyfish2", r2.getText());