我怎样才能调用通过Apache的骆驼RESTful服务? [英] How can I invoke a RESTful service through Apache Camel?

查看:187
本文介绍了我怎样才能调用通过Apache的骆驼RESTful服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的是HTTP方法来调用某些URL,这将创造一个JIRA问题。

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

现在我想使用Apache的骆驼,我该如何使用呢?

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.

感谢

推荐答案

您可以很容易地使用 CXFRS组件;如果你需要使用 HTTP组件出于某种原因,你可以很容易地使用它作为很好地做到这一点:

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" />

当然,你需要前往的路线,这部分之前,充实与的myKey 头消息。

这篇关于我怎样才能调用通过Apache的骆驼RESTful服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆