Hello,

I just wanted to extend my routing

<route>
  <from  uri=“jetty:// .. “/>
  <inOut uri=“bean:call?method=me(*)”/>
</route>

by a content routing based on the HTTP header ‘Content-Type’ like

<route>
  <from  uri=“jetty:// .. “/>
  <choice>
    <when>
      <simple>${in.headers[‘Content-Type’] == ‘application/json’</simple>
      <to uri=“bean:call?method=me(*,true)”/>
    </when>
    <when>
      <simple>${in.headers[‘Content-Type’] == ‘application/xml’</simple>
      <to uri=“bean:call?method=me(*,false)”/>
    </when>
    <otherwise>
      <to uri=“bean:call?method=oldStyle(*)”/>
    </otherwise>
  </choice>
</route>

Using ‘headers’, ‘header’ with and without ‘in’ did not work. 

I think I thought to much about it. Thanks for any help.

regards,
harald

Reply via email to