[每日一学]apache camel简介

apache camel 是轻量级esb框架。如下是它的架构图:

 它有几个比较重要的概念就是:

1.endpoint,所谓的endpoint,就是一种可以接收或发送数据的组件。可以支持多种协议,如jms,http,file等。

2.processor,它是用来处理具体业务逻辑的组件。

3.route,用来路由,指示数据从哪里来到哪里去,中间用哪个processor处理。

而processor之间用exchange对象来传送数据,有点像jms,通俗一点就像上学时传的小纸条,

所以:exchange对象就是processor,endpoint所有camel组件之间传送数据的小纸条:)。

那么camel主要用在哪个领域或哪个场景呢?以下是apache camel 官网上的说明:

Camel empowers you to define routing and mediation rules in a variety of domain-specific languages, including a Java-based Fluent API, Spring or Blueprint XML Configuration files, and a Scala DSL. This means you get smart completion of routing rules in your IDE, whether in a Java, Scala or XML editor.

Apache Camel uses URIs to work directly with any kind of Transport or messaging model such as HTTP, ActiveMQ, JMS, JBI, SCA, MINA or CXF, as well as pluggable Components and Data Format options. Apache Camel is a small library with minimal dependencies for easy embedding in any Java application. Apache Camel lets you work with the same API regardless which kind of Transport is used - so learn the API once and you can interact with all the Components provided out-of-box.

Apache Camel provides support for Bean Binding and seamless integration with popular frameworks such as CDISpring, Blueprint and Guice. Camel also has extensive support for unit testing your routes.

还有stackoverflow上的讨论:

http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel

按我的理解,camel就是企业信息集成框架,它提供了很多简单好用而又强大的组件,用户可以根据场景来选择不同的EIP(企业集成模式)来实现自己的需求,以响应快速变化的业务。可以把它当成企业信息总线(ESB)的轻量级实现。

本人精通java高并发,DDD,微服务等技术实践,专注java,rust技术栈。 本人姓名郭莹城,坐标深圳,前IBM架构师、咨询师、敏捷开发技术教练,前IBM区块链研究小组成员、十多年架构设计工作经验,《区块链核心技术与应用》作者之一, 现聚焦于:区块链创投与交易所资源对接和技术咨询。 工作微信&QQ:360369487,区块链创投与交易所资源对接,加我注明:博客园+对接,技术咨询和顾问,加我注明:博客园+顾问。想学习golang和rust的同学,也可以加我微信,备注:博客园+golang或博客园+rust,谢谢!
原文地址:https://www.cnblogs.com/gyc567/p/5208317.html