Apache Camel#1-Apache Camel简介

你好,世界!

这是我的第一篇文章,所以我决定写一下最近几个月我经常使用的框架。

一种pache Camel is a very powerful integration framework, it is used as a mediation engine between two systems, it has a great community, large codebase with over 200 components which can be used out of the box and of course it is written in Java.

On project official website you can find documentation and all info about releases.

骆驼语境

上下文是骆驼应用程序的心脏,它代表运行时系统。

骆驼路线

样本路线:

Apache Camel#1-Apache Camel简介_第1张图片

说明:

您可能已经注意到Route类扩展了RouteBuilder类,您将从中继承配置并在其中编写路由。

I used JavaDsl in this route, you can use any other dsl that camel supports.

errorHandler(deadLetterChannel(“ mock:errorRoute”))-这是此特定路由的错误处理程序,如果发生任何异常,则消息将发送到死信模拟队列“ errorRoute”。

from("timer:timerName?period=5000") - "from" is like an endpoint in camel context. In this particular case, it is timer component(scheduler) which will trigger route execution every 5 seconds, timer name is "timerName". You can check more about that on this link.

log(“ Route start!”)-这是骆驼的日志组件,它将在控制台中打印文本。

to(“ mock:anotherRouter”)-“ to”表示将在哪个端点,队列或路由消息上发送。 “ mock:anotherRoute”表示将在其上发送消息的模拟队列。

这些是关于骆驼的最基本的东西。

If you are interested in learning a little more about Apache Camel feel free to contact me here or on gitter -> @djoleb .

谢谢!

from: https://dev.to//djoleb/introduction-to-apache-camel-7m9

你可能感兴趣的:(java)