4

I am trying to check :

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

Body is the json:

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

But this condition doesn't work. I've tried as well:

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

Could you please suggest me something?

Sergii Getman
  • 3,845
  • 5
  • 34
  • 50

2 Answers2

5

I guess the body is maybe not a String, then try with

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

And btw what version of Camel do you use?

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
1

Actually this case:

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

didn't work cause: In Camel the message body can be of any types. Some types are safely readable multiple times, and therefore do not 'suffer' from becoming 'empty'.

It fixes by Stream caching

Sergii Getman
  • 3,845
  • 5
  • 34
  • 50