Phil
Phil

Reputation: 50456

How to use a header value inside an XML attribute using Apache Camel?

I have the following in a camel route, but it doesn't seem to get the header value. Is this the right way to do it?

<to uri="ahc:http://${header.freeNasServerIp}:80/api/v1.0/storage/volume/"/>

Upvotes: 0

Views: 853

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55555

See this FAQ about dynamic to: http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html


See this link How can I invoke a RESTful service through Apache Camel?

Answer specific to this question is:

<recipientList>
<simple>ahc:http://${header.freeNasServerIp}:80/api/v1.0/storage/volume/</simple>
</recipientList>

Upvotes: 1

Related Questions