自定义 Camel 组件可以在内部使用路由和其他组件吗? [英] Can a custom Camel component use routes and other components internally?

查看:33
本文介绍了自定义 Camel 组件可以在内部使用路由和其他组件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑为特定的基于 http 的服务开发自定义 Camel 组件,以便封装该服务的一些细节.根据自己的路由来实现我的组件似乎很自然,该路由执行一些转换,然后委托给 http4 端点.

I am considering developing a custom Camel component for a specific http-based service, in order to encapsulate some specifics of that service. It would seem natural to implement my component in terms of its own route that does some transformations and then delegates to a http4 endpoint.

但是,Camel 文档 不包括在其他人的条款,并且似乎假设组件是通过非 Camel 方式实现的.但是重新做httpclient集成感觉不对,因为Camel已经有了这个.

However, the Camel Documentation does not cover the case of a component being implemented in terms of others, and seems to assume that components are implemented by non-Camel means. But it feels wrong to re-do the httpclient integration, since Camel already has this.

组件可以创建自己的路由并使用其他组件吗?如果是,有人能举个例子吗?

Can a component create its own routes and use other components? If yes, can anyone point to an example?

推荐答案

借助 camel-context 组件,您可以在骆驼上下文组件内部定义路由.

With the help of camel-context component you can define a route inside of camel-context component.

这篇关于自定义 Camel 组件可以在内部使用路由和其他组件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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