Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Message Selector

Tags:

jms

message

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.

like image 334
Moonlit Avatar asked Feb 20 '23 14:02

Moonlit


1 Answers

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.

like image 97
Shashi Avatar answered Mar 28 '23 12:03

Shashi