How do I identify a message using JMS Correlation ID? I'm using code like the following, but I can't get the message out of the queue. The tool has confirmed that there is a message in the queue with JMSCorrelationID ='ID: 1234567' set in PropertiesText. What's wrong? Is it possible to include spaces in the value specified for JMSCorrelationID?
Is it possible to use a value like 'ID: 1234 ABC'?
Sender:
MessageProducer mproducer;
Session qSession;
...
String selectKey = "'' ID: 1234567'";
ObjectMessage msg = qSession.createObjectMessage (data);
msg.setJMSCorrelationID (selectKey);
mProducer.send (msg);
Receiver
Session qSession;
...
String selectMsgKey = "JMSCorrelationID ='ID: 1234567'";
MessageConsumer mConsumer.createConsumer (queue, selectMsgKey);
mConsumer.receive (60000);
I use ActiveMQ Artemis.