0

Is there any way to set header with boolean value for checking contains like this.

<setHeader name="status">
    <simple>${headers.type} contains 'client'</simple>
 </setHeader>

This should set status as true if type contains client else false.

DummyGuy
  • 425
  • 1
  • 8
  • 20
  • According to the documentation https://camel.apache.org/components/latest/languages/simple-language.html And an example with contains, testing if the title contains the word Camel `simple("${in.header.title} contains 'Camel'")` – R.Groote Aug 10 '21 at 14:45
  • @R.Groote I tried this but its not storing boolean value into header. it gives me values like client contains 'client'. – DummyGuy Aug 10 '21 at 15:10

1 Answers1

0

Check the docs, you need resultType

<setHeader name="status">
    <simple resultType="java.lang.Boolean">${headers.type} contains 'client'</simple>
 </setHeader>
Greenev
  • 871
  • 6
  • 23