1 Reply Latest reply on Dec 6, 2012 10:28 PM by clebert.suconic

    Retrieving messageID after synchronous/transacted send with hornetq core

    frankgrimes97

      Hi All,

       

      I'm trying to push a message on the queue and return the messageId to an external client.

      However, message.messageID is always 0.

       

      e.g.

       

      ClientSession session = hornetQClientSessionFactory.createTransactedSession();

      ClientProducer producer = session.createProducer("test");

      ClientMessage message = session.createMessage(true);

      message.getBodyBuffer().writeString("TESTING");

      producer.send(message);

      session.close();

       

      message.getMessageID() // this is still 0 after the send

       

      How can I receive the messageId under which the message is persisted on the server?

       

      Thanks,

       

      Frank Grimes