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: 
_AnonymousUser
Specialist III
Specialist III

CMessagingEndpoint - URI with dynamic parameters

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"


Thanks for help!
Labels (2)
3 Replies
Anonymous
Not applicable

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.
_AnonymousUser
Specialist III
Specialist III
Author

This code works:
"sql:select * from table where id=:#${header.id}?dataSourceRef=myDS"

The problem was the missing ":#" before the parametervalue!
Anonymous
Not applicable

I didn't know this. I was basing my answer on trying to change direct and vm endpoints dynamically. Nice to know.