0

I am new to apache camel. I want to create a service bus (middle ware) using apache camel by making a jetty Post request and then get the response from the server.

Here is what I've done

<route streamCache="true">
  <from uri="jetty:{{wrapperEntry.protocol}}://{{wrapperEntry.host}}:{{wrapperEntry.port}}/rsb/SubmitNewCaseForAndroid?continuationTimeout=0" />
  <convertBodyTo type="java.lang.String" />
   <to uri="direct:helloworld"/>
</route>

<route streamCache="true">
    <from uri="direct:helloworld"/>
 <transform>
    <simple>
    Hello World
    </simple>
  </transform>

    <convertBodyTo type="java.lang.String" />
</route>

the request goes successfully to the server and submit my case, other wise I cannot get the response back from the server.

Note: the response comes from the is the server is string it comes like this 'code':0, 'description':'operation completed succrssfully', 'complaintId':'45285'

Thank in Advacnce

Joey
  • 11
  • 10
  • Do you want your route to send the POST (``) or do you want to start a route with a jetty server receiving a POST (``)? – Ralf May 08 '16 at 15:47
  • I'm with Ralf here. I think the question you have and the code you posted are paradoxical. Maybe it would be helpful if you explain more what you are trying to achieve. – Ramin Arabbagheri May 08 '16 at 21:43
  • @Ralf Sorry for the misunderstanding. I send a request with this URL and I got "Hello World" in the response body. I want to get the response stated upward that comes back from the server. the request type is POST. – Joey May 09 '16 at 08:02
  • Your sample route is ` – Ralf May 09 '16 at 08:44
  • @Ralf so how can I send a post and then get back the response ? – Joey May 09 '16 at 09:09
  • You have to trigger the route by some means (timer, etc.) and then use ` – Ralf May 09 '16 at 13:35
  • @Ralf Thank you so much. is there a tutorial or an example so I can walkthrough it? – Joey May 09 '16 at 15:03
  • @Ralf is this assupmtion is right ? – Joey May 10 '16 at 08:19
  • Here's a link to [an article](http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html) explaining message exchange patterns in Camel, it should help. – Cyäegha May 10 '16 at 12:30
  • @Ralf can you help me on this http://stackoverflow.com/questions/37831460/jms-from-synchronous-to-asynchronous – Joey Jun 15 '16 at 09:31
  • @Cyäegha can you help me on this http://stackoverflow.com/questions/37831460/jms-from-synchronous-to-asynchronous – Joey Jun 15 '16 at 09:31

0 Answers0