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.
Solved! Go to Solution.
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.
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?
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!!
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Find out how to migrate from one database to another using the Dynamic schema
Learn how to use an API-First Approach to Modernize your Applications
Pick up some tips and tricks with Context Variables