My question is when you using JmsXA and not enlist a transaction.
if you add this following test to XATransactionTest, the test will hang (as the message
was never sent):
public void test_JmsXA_NonTransactional() throws Exception
| {
| Transaction suspended =
TransactionManagerLocator.getInstance().locate().suspend();
|
|
| ConnectionFactory cf =
(ConnectionFactory)ic.lookup("java:/JCAConnectionFactory");
|
|
| Connection conn = cf.createConnection();
|
|
|
| Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
| MessageProducer prod = session.createProducer(queue);
| prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
|
| TextMessage m = session.createTextMessage("message one");
| prod.send(m);
| m = session.createTextMessage("message two");
| prod.send(m);
|
| conn.close();
|
| conn = cf.createConnection();
|
| session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
| MessageConsumer cons = session.createConsumer(queue);
|
| conn.start();
|
| TextMessage rm = (TextMessage)cons.receive();
| assertEquals("message one", rm.getText());
| rm = (TextMessage)cons.receive();
| assertEquals("message two", rm.getText());
|
| conn.close();
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968702#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...