[每日一學]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)的輕量級實現。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM