Is there a way to change the messageselector or do I need to close the current message consumer and create another one with a new selector string?
session.createConsumer(destination, "type = 'mytype'");
Scenario: I want to receive a message of a specific type from the queue. After this I want to receive a message of another type from the queue.
JMS API does not specify a way to change the message selector once the consumer has been created. To change the message selector, a consumer must be closed and reopened with a different selector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With