Reputation: 702
I'm starting using Mule and have some trivial questions. Here one of them. Suppose you store the address of a url to invoke later on a process on a property file. Then you want to use an http endpoint specifying this url. It works fine, you simply put in the address: ${URL_ADDRESS} and that's it.
Now if your url is calculated and set on a flowVar, why the following code does not work?
<http:outbound-endpoint exchange-pattern="request-response" method="GET" address="#[flowVars['URL_ADDRESS']]" doc:name="HTTP"/>
It throws this exception:
java.lang.IllegalArgumentException: Address '#[flowVars['URL_ADDRESS']]' for protocol 'http' should start with http://
Why is it checked at compilation time? How can I do to set it at runtime?
Upvotes: 0
Views: 1959
Reputation: 33
you should use the flow variables in below format. Either #[FileName] or #[flowVars.FileName]
Upvotes: 0
Reputation: 2319
The protocol cannot be dynamic. You should change your outbound endpoint to
<http:outbound-endpoint exchange-pattern="request-response" method="GET" address="http://#[flowVars['URL_ADDRESS']]" doc:name="HTTP"/>
Upvotes: 4