Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJMSInput selector usage

Hi, how to user selector at tJMSInput component?

I have JMS Message with Properties IterationID with values 1,2,3..

MESSAGE_FROM field "queue.test?selector=IterationID=1" does not work.

How to set MESSAGE_SELECTOR_EXPRESSION? "IterationID=1" does not work.

Could you provide me an working example?

Thanks, Martin


PS: JMS Messages are created via tJMSOutput with help of tJavaRow

javax.jms.TextMessage m = session_tJMSOutput_1.createTextMessage();
m.setText(input_row.message);
m.setStringProperty("IterationID","1");
output_row.message = m;
Labels (3)
1 Reply
Anonymous
Not applicable
Author

From ActiveMQ DOCS:
The JMS spec states that a String property should not get converted to a numeric when used in a selector. So for example, if a message has the 'age' property set to String '21' then the following selector should not match it: 'age > 18'. Since ActiveMQ support STOMP client which can only send messages with string properties, that restriction is a bit limiting. If you want your JMS selectors to auto-convert String properties the the appropriate number type, just prefix the the selector with 'convert_string_expressions:'. If you changed selector in the previous example to be 'convert_string_expressions:age > 18', then it would match the message.
Therefore:
MESSAGE_SELECTOR_EXPRESSION? "IterationID= '1'"