Apache的骆驼:做处理器和豆类达到同样的目的是什么? [英] Apache Camel: do Processors and Beans serve the same purpose?

查看:126
本文介绍了Apache的骆驼:做处理器和豆类达到同样的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好像都达到同样的目的。有没有使在某些情况下的一个有用而不是其他什么区别呢?

It seems like both serve the same purpose. Is there any difference that makes one useful in certain situations and not the other ?

推荐答案

在实践中,他们都非常相似,但处理器比豆较为有限。我通常使用一个处理器简单的用例,仅仅与Exchange交互。此外,内嵌处理器是一个伟大的方式,而无需创建一个单独的类进行交互。

In practice, they are very similar, but a Processor is more limited than a Bean. I generally use a Processor for simple use cases that just interact with the Exchange. Also, inline processors are a great way to interact without having to create a separate class.

豆类提供更大的灵活性,并支持真正的POJO的方法。这使您可以更轻松地与现有的API集成(只需要输入/输出转换匹配,等等)。

Beans provide more flexibility and also support a true POJO approach. This allows you to more easily integrate with existing APIs (just need to convert the inputs/outputs to match, etc).

豆类还提供了强大的功能/灵活性与问候骆驼路由/ EIP集成,包括...

Beans also provide great features/flexibility with regards to Camel routing/EIP integration, including...


  • 丰富的绑定,让您快速绑定从数据交易所bean方法等属性。

  • rich set of bindings that allow you to quickly bind data from the Exchange to attributes of a bean method, etc.

消费 /的生产允许您以可重用的方式与终端交互

POJO consuming/producing allow you to interact with endpoints in a reusable manner

作为前pressions / predicates (对POJO EIP执行...过滤器等)

used as expressions/predicates (for POJO EIP implementation...filters, etc)

这篇关于Apache的骆驼:做处理器和豆类达到同样的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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