Ravi Kiran Va wrote:I currently dont remember exactly how to do this , but as per my knowledge you need to google on
"Configuring MDB Message Selectors"
and for this to work you need to set Header properties to your Message also .
Google it you will find it .
before sending a message to a queue or topic add a property to it which would uniquely identify it like
ObjectMessage obj = session.createObjectMessage();
and when configuring the listener or the mdb to listen to a queue and pickup only messages which have type "XYZ"
String messageSelector = "type = 'XYZ'"
TopicSubscriber sub = session.createSubscriber(topicName,messageSelector,true);
there are numerous operators other than '=', you can even do a wildcard match for the messageSelector like "'type LIKE 'XYZ%'"
this is with reference to ActiveMQ. the creation of subscriber might vary depending upon the third party provider.