Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I know you can use a tContext Component in a job or the implicit tContextLoad functionality to load context variables from a file.
I was wondering how you would do the equivalent inside a talend route?
Cheers
n999
Input from talend:
Some components like the cMQConnectionFactory will throw an error with simple {{}} expressions.
You need to use the following instead.
camelContext.resolvePropertyPlaceholders("{{propertyName}}")
Ah I see. I've not actually tried this but I suspect that this is because the cMQConnectionFactory is initiated before the routes are started. A Talend Route is actually a Camel Context. The endpoints to endpoints within the Talend Route (Camel Context) are really the Camel Routes. Yes, it is confusing and quite frustrating that this nomenclature has been used. Going back to my first sentence, since the cMQConnectionFactory is started at the very beginning of the Camel Context, the curly brackets method is interpreted as a literal Java String.
EDIT: I have just seen your last post while checking something you had said. The solution you have been given makes sense. I've not tried it, but will give it a go next time I need to do this.
That tutorial is what got me going with these. Once you get the hang of it, it is really powerful.