I am using Stringboot, springboot starter artemis and camel
here is my dependencies for them:
compile('org.springframework.boot:spring-boot-starter-artemis')
compile 'org.springframework:spring-jms'
compile 'org.apache.activemq:artemis-jms-client:1.5.6'
compile 'org.apache.activemq:artemis-jms-server:1.5.6'
// https://mvnrepository.com/artifact/org.apache.camel/camel-jms
compile group: 'org.apache.camel', name: 'camel-jms', version: '2.20.2'
Here is my code(I am not using jms template here due to some reason)
Connection connection = connectionFactory.createConnection();
try {
connection.setClientID(clientId);
connection.start();
//Create a JMS session
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Topic topic = ActiveMQJMSClient.createTopic(processedHeaders.get(jmsdestination));
******JmsMessageUUID will dynamic, i have added JmsMessageUUID value = ID:142536687 as a example*********
String selector = "JmsMessageUUID = 'ID:142536687'";
//Create the subscription and the subscriber.
MessageConsumer subscriber = session.createConsumer(topic,selector);
//Consume the message from the durable subscription
TextMessage messageReceived = (TextMessage) subscriber.receive();
System.out.println("Received message: " + messageReceived.getText());
// Acknowledge message
messageReceived.acknowledge();
} finally {
if (connection != null) {
// Close our JMS resources!
connection.close();
} }
}
i am trying to select message with JmsMessageUUID, it is basically a random string which is set during send message, Jms selector is unable to find out message, but when i am not using selector than successfully consumed message also I have checked the jms properties in received message, and the JmsMessageUUID is available in the properties with same string value.
I am unable to figure out why selector is not working ? Please help me here ..
I have also found JMSMessageID filter worked with Queue but not with Topoc:(