activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Meeraj Kunnumpurath" <>
Subject ActiveMQ and JTA
Date Fri, 31 Mar 2006 16:05:20 GMT

I am using ActiveMQ 4.0 M4 standalone with the message consumers and
producers running from a separate Weblogic instance. I have got the
following code to send a message using JTA transaction demarcation,

Context ctx = null;
Connection con = null;
Session sess = null;

try {
        context = new InitialContext();
        UserTransaction utx =
        ConnectionFactory cf = new
        Destination dst = new ActiveMQQueue("submission.queue");
        Connection con = cf.createConnection();
        Session sess = con.createSession(false,

        MessageProducer prod = sess.createProducer(dst);

} catch(Exception ex) {
        throw new RuntimeException(ex);
} finally {
        closeResources(ctx, con, sess);

The message is still being published, despite the transaction being
rolled back. Do I need to do anything else so that the ActiveMQ session
get enlisted with the transaction manager.

Any pointers would be highly appreciated.

Kind Regards



    You can find us at

This communication is confidential and intended for 
the exclusive use of the addressee only. You should 
not disclose its contents to any other person.
If you are not the intended recipient please notify 
the sender named above immediately.

Registered in England, No 1023742,
Registered Office: Voca Limited
Drake House, Three Rivers Court,
Homestead Road, Rickmansworth,
Hertfordshire, WD3 1FX

This message has been checked for all email viruses by MessageLabs.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message