Apache camel spring dsl check if body contains string

I am trying to check:

<simple>${body} contains 'verification'</simple>

The body is json:

{"verification": {"email": "bb@wp.pl", "code": "1234"}}

But this condition does not work. I also tried:

<simple>${body} contains &#39;verification&#39;</simple>
<simple>${bodyAs(String)} contains 'verification'</simple>
<simple>${body.verification} != null</simple>

Could you offer me something?

+4
source share
2 answers

I think the body may not be a string, and then try

<simple>${bodyAs(String)} contains 'verification'</simple>

And what version of Camel are you using?

+5
source

All Articles