Vikas Bhardwaj
Vikas Bhardwaj

Reputation: 73

How to use Camel Exchange Header in Camel Component propertites?

I am using a CXF component which will take username and password as its properties and I am getting username and password in Camel Exchange Header, So I tried to set this way:

<to uri="cxf:{myurl}?dataFormat=MESSAGE&amp;username=${in.header.username}&amp;password=${in.header.password}"/>

But it is giving me authentication failure error as username and password are not set properly.

Upvotes: 1

Views: 547

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55550

See this FAQ about how to use dynamic values in the to

So by using recipient list EIP you can do this

<recipientList>
  <simple>cxf:{myurl}?dataFormat=MESSAGE&username=${in.header.username}&password=${in.header.password}"</simple>
</recipientList>

Upvotes: 1

Related Questions