I'm trying to push a message on the queue and return the messageId to an external client.
However, message.messageID is always 0.
ClientSession session = hornetQClientSessionFactory.createTransactedSession();
ClientProducer producer = session.createProducer("test");
ClientMessage message = session.createMessage(true);
message.getMessageID() // this is still 0 after the send
How can I receive the messageId under which the message is persisted on the server?
MessageID is only set at the server.
If you look at the implementation only ServerMessage has a method to set the messageID.
If you need to co-relate messages use your own properties, as the messageID is an internal property for the server's, not to be assigned at the client.