One Star

dynamic config tMomOutput component

How to dynamically configure the tMomOutput for ActiveMQ with the "To" queue name passed in from the request.
More specifically, I have a job listen to a request using the tMomInput component. the response queue name is embedded in the request. My job will decode the response queue name, save it to a context variable "replyQueueName", then use it to configure the tMomOutput component (the value for the field "To" of the tMomOutput component is: context.replyQueueName).
This is not working, it seems the tMomOutput component is configured before the job actually starts, so it takes whatever the initial value of the context variable, not the dynamic value I assigned after decoding the request message.
Could someone tell me how to get around this?
Thanks
1 REPLY
Employee

Re: dynamic config tMomOutput component

Hi Xiaodong,
If you have access to the ESB components, the best way to do this is with cJMS and by manipulating the header CamelJMSDestinationName header (see doc link below).
If you must use a DI job, I think you could spawn a new job (tRunJob?) and configure the context property as needed so it's effective on initialization of that job. Of course, this is not efficient. So Mediation is a much better solution. If you still want to see dynamic queue/topic resolution in tMomOutput, I suggest creating a new JIRA and mark it as a work item (link below).
http://camel.apache.org/jms.html
https://jira.talendforge.org/secure/Dashboard.jspa
Best Regards,
Ben