You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by npa <np...@gmail.com> on 2014/04/25 16:36:40 UTC

Sending payload from http to jms...Camel.

I am trying to have a camel route, which would accept a payload on a http
endpoint and then write that payload to a JMS queue.

The route that I have so far is below. But an empty message gets delivered
to the jms queue. A message gets there, but it has no body.

Heres the route:

    <route >
    	<from uri="jetty:http://0.0.0.0:8050/add/Customer"/>
    	<inOnly uri="jms:queue:Q.Customer" />
    </route>

Heres the payload that I'm sending into to
'`http://0.0.0.0:8050/add/Customer`' endpoint:

   
     <Customer xmlns="http://www.openapplications.org/9"
xmlns:lw="http://www.org/9">
        <Name>John</Name>
        <Gender>Female</Gender>
     </Customer>

Any inputs on why the message body is not being written to the jms queue?
Thanks...




--
View this message in context: http://camel.465427.n5.nabble.com/Sending-payload-from-http-to-jms-Camel-tp5750616.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending payload from http to jms...Camel.

Posted by scottdawson <sc...@gmail.com>.
I guess you're using POST or PUT to send the message to the HTTP endpoint,
right?

I've used this route successfully within ServiceMix:
      <route>
        <from uri="jetty:http://0.0.0.0:8182/async"/>
        <removeHeaders pattern="*"/> 
        <to uri="activemq:queue:cds?username=smx&amp;password=smx"/> 
        <setBody><simple>JMSCorrelationID:
${header.JMSCorrelationID}</simple></setBody>
        <setHeader headerName="Exchange.CONTENT_TYPE">
           <constant>text/plain</constant>
        </setHeader>
      </route>

The removeHeaders is not essential. It's just there so that request headers
are not copied to the response. This route sends the correlation ID back to
the HTTP client.

Regards,
Scott



--
View this message in context: http://camel.465427.n5.nabble.com/Sending-payload-from-http-to-jms-Camel-tp5750616p5750651.html
Sent from the Camel - Users mailing list archive at Nabble.com.