title: Camel check header value after split
body: <p>I have a problem in my Camel Route when I try to check the value of a header.
  So what is happening is that I go to a processor, do my stuff, then I create 2 different message that I put inside the body.
  After that I go back on my route, I split my body so I can route the 2 differents messages, and there I use a .choice().when() on the header CamelFileName to check if it contains some value.
  It doesn't find the value and then doesn't go inside the .when()</p>
  
  <p>Here is the source code to make it more clear :</p>
  
  <pre><code>// My route
  from("myQuartz")
      .routeId("myId")
      .bean(myProcessor.class)
      .split(body())
      .to("log:test?showAll=true&amp;multiline=true")
      .log('[${header.CamelFileName}]')
      .choice()
          .when(header('CamelFileName').contains('myString1'))
              // do my stuff
          .endChoice()
          .when(header('CamelFileName').contains('myString2'))
              // do my other stuff
          .endChoice()
          .otherwise()
              .log("It did not go inside the when")
              .to("log:test?showAll=true&amp;multiline=true")
          .endChoice()
      .end()
  </code></pre>
  
  <p>So here I am simply trying to check if the CamelFileName header contains a string (it's not a variable), but it keep going inside the otherwise.
  The log just after the split show me that the CamelFileName header is correct and do contains the string I am looking for.</p>
  
  <p>I tried different ways of checking the value inside the when() such as using a simple(), but it doesn't work. 
  My file is a groovy file.</p>
  
  <p>Thanks for your help.</p>
  
  <p>EDIT :
  So to explain what is inside my body I will show you the processor source code.
  I create two DefaultMessage, 
  I set them a body and a CamelFileName header, 
  I put them into a list and then I put that list into my exchange body. 
  After that I go back to the route and I split the body so it will separate the two messages and route them.
  Here is what's happening in my processor :</p>
  
  <pre><code>// Message 1 
  DefaultMessage message1 = new DefaultMessage()
  message1.setBody(bodyContent)
  def fileName1 = "myString1_blablabla.txt"
  message1.setHeader("CamelFileName",fileName1)
  listMessages.add(message1)
  
  // Message 2
  DefaultMessage message2 = new DefaultMessage()
  message2.setBody(bodyContent)
  def fileName2 = "myString2_blablabla.txt"
  message2.setHeader("CamelFileName",fileName2)
  listMessages.add(message2)
  
  exchange.in.setBody(listMessages)
  </code></pre>