Hi,
how can I add a dynamic value to the URI of cMessagingEndpoint?
Example:
I want so select data from database where id = <param>
The value for <param> is hold in header of the message.
I try to do like this, but that was not successfull:
"sql:select * from table where id = ${header.id}?dataSourceRef=myDS"
Unfortunately as soon as the route is started, the endpoints are fixed. You can use code to start and stop sub-routes. This would allow you to stop a sub-route, change its endpoint and restart it, but that takes a fair bit of code and is not ideal. An easier way of achieving this might be to use a cTalendJob. You can send the message to the cTalendJob, the job called by the cTalendJob will act (give or take) just like a normal Talend job, which means you can easily use dynamic SQL. You can then return your message to the route.