How to change the message selector

Is there a way to change the message sensor or do I need to close the current message user and create another one with a new selector line?

session.createConsumer(destination, "type = 'mytype'"); 

Scenario: I want to receive a message of a certain type from a queue. After that, I want to get a different type of message from the queue.

+4
source share
1 answer

The JMS API does not indicate how to change the message selector after creating the consumer. To change the message selector, the consumer must be closed and reopened by another selector.

+8
source

Source: https://habr.com/ru/post/1411026/


All Articles