camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harald <>
Subject Routing based on exchange header content-type
Date Tue, 19 Aug 2014 18:50:40 GMT

I just wanted to extend my routing

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

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

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

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

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

View raw message