You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2017-02-23 16:37:16

martin.pelikan
Member
16 posts

martin.pelikan said:

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;

Last edited by martin.pelikan (2017-02-23 17:16:06)

Offline

#2 2017-02-24 13:43:52

martin.pelikan
Member
16 posts

martin.pelikan said:

Re: tJMSInput selector usage

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'"

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy