用于异步调用的 Apache Camel

发布于 2024-07-14 15:20:04 字数 101 浏览 7 评论 0原文

使用 Apache Camel 进行异步请求有意义吗? 或者我应该使用 JMS 服务器来使用简单的 MoM。 我不需要任何企业集成模式。

任何帮助都会有用的。

Does it make sense to use Apache Camel for Asynchronous requests? Or should I use simple MoM using a JMS server.
There are no Enterprise Integration Patterns that I'll require.

Any help would be useful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吻泪 2024-07-21 15:20:04

即使您尚未使用任何企业集成模式 - Camel 也非常擅长将消息传递集成到您的应用程序中,而 隐藏所有中间件 API,同时让您轻松地在所有各种不同的中间件技术之间切换 通常只需更改一两个字符串即可。

例如,请参阅这些链接以获取更多详细信息

有一个 POJO 消息传递示例,引导您使用Camel 纯粹是一种将消息传递集成到 POJO 中的方式

Even if you are not using any Enterprise Integration Patterns (yet) - Camel is great at integrating messaging into your application while hiding all of the middleware APIs while letting you easily switch between all the various different middleware technologies usually by just changing one or two strings.

e.g. see these links for more detail

There is a POJO Messaging Example that walks you through using Camel purely as a way to integrate messaging into your POJOs

留一抹残留的笑 2024-07-21 15:20:04

使用 Camel 进行异步调用确实有意义,特别是因为它可以干净地处理回调。 例如:

template.asyncCallback("activemq:queue:longTasks", request, callback);

回调是一个 org.apache.camel.spi.Synchronization 对象,它处理响应和失败条件。

It does make sense to use Camel for async calls, especially because it can handle callbacks cleanly. For example:

template.asyncCallback("activemq:queue:longTasks", request, callback);

Where a callback is a org.apache.camel.spi.Synchronization object that handles both responses as well as failure conditions.

攒一口袋星星 2024-07-21 15:20:04

添加到其他答案:
Camel 还为常见的编程任务提供了许多非常有用的实用程序。

我已经 8 个月没有使用它了,但我将在下一个项目中使用它......下周的 sprint 0。

也许,很快我也会对最新的camel产生更多疑问。

快乐编码。

To add to the other answers:
Camel also provides many very useful utils for common programming tasks.

I haven't used it in 8 months, but I'll be using it on my next project...sprint 0 next week.

Perhaps, I too will have more questions on the latest of camel soon.

Happy coding.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文