title: Apache Camel conditional routing
body: <p>I have a service which has two operations. </p>
  
  <pre><code>RegisterUser
  UpdateUser
  </code></pre>
  
  <p>I have a camel rout:</p>
  
  <pre><code>&lt;camel:route id="myRoute"&gt;
      &lt;camel:from uri="cxf:bean:myListenerEndpoint?dataFormat=POJO&amp;amp;synchronous=true" /&gt;            
      &lt;camel:bean ref="processor" method="processMessage"/&gt;
      &lt;camel:to uri="xslt:file:resources/service/2.0.0/UserRegistration.xsl"/&gt;
      &lt;camel:to uri="cxf:bean:myTargetEndpoint"/&gt;
  &lt;/camel:route&gt;
  </code></pre>
  
  <p>In my processor bean, when I specify: </p>
  
  <pre><code>RegisterUser registerUser = exchange.getIn().getBody(RegisterUser.class);
  </code></pre>
  
  <p>I get the register user object. Everything works fine.
  The problem is that I want camel to route my request conditionally, for e.g:</p>
  
  <p>If the service operation is <code>RegisterUser</code> I want to route the message to my specific bean and if the service operation is <code>UpdateUser</code> I want to route the message to the other bean.</p>
  
  <p>I have tried to use camel xPath, but it not seems to be working.</p>
  
  <pre><code>&lt;camel:route id="myRoute"&gt;
      &lt;camel:from uri="cxf:bean:myListenerEndpoint?dataFormat=POJO&amp;amp;synchronous=true" /&gt;  
      &lt;camel:choice&gt;
          &lt;camel:when&gt;
              &lt;camel:xpath&gt;
                  //RegisterUser
              &lt;/camel:xpath&gt;
              &lt;camel:bean ref="processor" method="processMessage"/&gt;
              &lt;camel:to uri="xslt:file:resources/service/2.0.0/UserRegistration.xsl"/&gt;
          &lt;/camel:when&gt;
      &lt;/camel:choice&gt;                        
      &lt;camel:to uri="cxf:bean:myTargetEndpoint"/&gt;
  &lt;/camel:route&gt;
  </code></pre>
  
  <p>I was searching how to set up camel to route to the different targets but did not find anything. Maybe somebody knows where might be the problem?</p>