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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to consume messages selectively using cJMS from ActiveMQ topic in Talend Route

I'm using Talend route and the cJMS component to push and pull message from the ActiveMQ topic.

I need to retrieve the message on the basis of some property so that message can be differentiated for the multiple consumers of the topic. How and Where can I set this property so that while pulling the message from MQ I can use it?

 

I've tried the URI properties in the "advance settings" of cJMS component but still it is picking all the messages.

 

How can I achieve this? Let me know if I can provide any other information.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi you need to use JMS selectors for filtering messages.
try using in advanced options
selector = header_FIELDNAME header_FIELDVALUE_using_sql_expresssion
see camel documentation for selector
http://camel.apache.org/jms.html

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi you need to use JMS selectors for filtering messages.
try using in advanced options
selector = header_FIELDNAME header_FIELDVALUE_using_sql_expresssion
see camel documentation for selector
http://camel.apache.org/jms.html
Anonymous
Not applicable
Author

Thanks for your response rchinta_talend.

 

I'm really new to this and as per my understanding I need to add the header first and then use that header as my selector. I tried changing the flow, please check the screenshot.

0683p000009M0W5.jpgHeader Setting0683p000009M0Pt.jpgSelector

 

0683p000009M0U5.jpgpublisher cjms

 

I tried understanding the documentation, but i didn't get any source to write the below expression.

 selector = header_FIELDNAME header_FIELDVALUE_using_sql_expresssion.

If it's not too much to ask, an example for the same would work for the me.

 

I'm still confused,

should I add the header and use it as selector in advance properties of consumer JMS?

or should I add the properties in advance options of publisher JMS and same properties in consumer JMS?

or should I not add the header at all?

How can I use the selector to filter?

 

Anonymous
Not applicable
Author

In my publisher route I used the cSetHeader to add a header with my message ("Header", "MyHeader" ).

In my subscriber route, in the advance properties of cJMS component i added a selector like following

"selector" ,"Header = 'MyHeader'".

Using this I'm able to pick messages selectively from the Topic.

 

Thanks for your help, rchinta_talend!!