camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sogabe <>
Subject camel-rest component not compatible with REST-DSL
Date Tue, 02 Feb 2016 06:47:56 GMT

I'm testing camel-rest with the folowing spring xml.

        <restConfiguration component="jetty" scheme="http" host="localhost"
port="8888" bindingMode="auto" >
            <dataFormatProperty key="xml.out.mustBeJAXBElement"
value="false" />
            <from uri="rest:get:/book:/{id}/" />    //  <---  (1)
            <to uri="direct:hello" />

            <from uri="direct:hello" />
            <process ref="bookProcessor" />

it can't work correctly with Accept header.

  $ curl -H 'Accept:application/json' http://localhost:8888/book/2/
  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <book id="2" title="Apache Camel">
But replace (1) camel-rest  with REST-DSL like this.

            <get uri="/book/{id}/" >
                <to uri="direct:hello" />

it works correctly.

  $ curl -H 'Accept:application/json' http://localhost:8888/book/2/
  {"date":1454395087688,"id":"2","title":"Apache Camel"}
Is camel-rest component not compatible with REST-DSL? 

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message