I have a Queue in my JMS. While sending messages to the queue I am mentioning the JMStype as 'XYZ'. At the consumer end I have an onMessage listener. What I want to know is the following
Thanks for your time to read my query.
I would suggest using a message selector rather than JMSType
for this purpose. Spring JMS
message listeners lets you filter messages based on JMS properties as well as JMS headers.
When writing messages to queue you could set a message poperty as "type='abc'"
, on the listener's configuration you could look for certain "types" by providing a messageSelector="type='abc'"
.
This way only the messages matching the selectors are picked from the queue.