There is a missing } in your simple expression, you need that to end
the left hand side
<simple>${in.headers[‘Content-Type’]} == ‘application/json’</simple>
On Tue, Aug 19, 2014 at 8:50 PM, harald <[email protected]> wrote:
> 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
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/