jasmeet24 jasmeet24 - 3 months ago 18
reST (reStructuredText) Question

How can I invoke a RESTful service through Apache Camel?

I am currently using a HTTP method for invoking some URL which will create a JIRA issue.

Now I want to use Apache Camel, how can I use that?

I need to invoke the following link through Camel:

http://localhost:8080/rest/api/2/project/" + key + /components


As I'm new to Camel, please suggest some solutions and examples too.

Thanks

Answer

You could easily use the CXFRS Component; if you need to do it using the HTTP Component for some reason you could easily use that as well:

<setHeader headerName="CamelHttpUri">
      <simple>http://localhost:8080/rest/api/2/project/${header.myKey}/components</simple>
</setHeader>
<inOut uri="http://doesnt.matter.we/override/it/anyways" />

And of course you will need to enrich your message with the myKey header before getting to this part of the route.

Comments