[Introduction to Camel of Apache]

Apache Camel ™ is a versatile open-source integration framework based on known Enterprise Integration Patterns.

 

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 CDI, Spring, Blueprint and Guice. Camel also has extensive support for unit testing your routes.

 

The following projects can leverage Apache Camel as a routing and mediation engine:

Apache ServiceMix - a popular distributed open source ESB and JBI container

Apache ActiveMQ - a mature, widely used open source message broker

Apache CXF - a smart web services suite (JAX-WS and JAX-RS)

Apache Karaf - a small OSGi based runtime in which applications can be deployed

Apache MINA - a high-performance NIO-driven networking framework

 

Apache Camel is an open source project under the Apache Foundation. It is a rule-based routing and processing engine that provides the implementation of Java objects for enterprise integration patterns, through application programming interfaces or declarative Java Domain Specific Language (DSL) to configure routing and processing rules. Its core idea is to get data from a from source, process it through a processor, and send it to a to destination.

The from and to can be the types we often encounter in project integration: a file in an FTP folder, a MQ queue, an HTTP request/response, a webservice, etc. Camel can be easily integrated into standalone applications , web applications running in containers, and integration with Spring.

 

Apache Camel has eleven Java libraries and engines with various integration modes, however it is not BPMN or ESB, although they can be implemented under this engine. Apache Camel is a tool for programmers to adjust and integrate problems.

 

Message

 

org.apache.camel.Message is a basic entity in Camel that contains data and routing, and Messages contains

 

Unique Identifier--java.lang.String type

Header information (Headers)--will provide some content hints, header information is organized into the form of name-value pairs, string-->Object

The body is an object of type Object, which means that you need to make sure that the receiver understands the content of the message. When the message sender and receiver use different content formats, you can use Camel's data conversion mechanism to convert it to a specific format. Predefined types can be automatically converted in many cases.

The fault flag is used to mark normal or faulty flags, usually defined by some standard classes, such as (WSDL)

Exchange

 

org.apache.camel.Exchange is an abstract session for communication between messages. Listed below is such a session, making the components more comprehensive

 

Exchange ID

MEP A message exchange pattern similar to InOnly or InOut. When the mode is InOnly, only IN-Message is included in the message exchange

Exception any exception in the routing process

Properties are somewhat similar to message headers, but they will last until the end of the entire exchange, and Camel may also use them for some special communication.

IN-Message

OUT-Message

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326561258&siteId=291194637