Apache Camel

26
Apache Camel Антон Архипов http://arhipov.blogspot.com http://anton-arhipov.livejournal.c

description

 

Transcript of Apache Camel

Page 1: Apache Camel

Apache CamelАнтон Архипов

http://arhipov.blogspot.comhttp://anton-arhipov.livejournal.com

Page 2: Apache Camel
Page 3: Apache Camel

SOA: Spaghetti-Oriented Architecture

Page 4: Apache Camel

http://camel.apache.org

What is Apache Camel?

Page 5: Apache Camel

A B

from(“a”).to(“b”)

Page 6: Apache Camel

from(“a”).choice().when().

method(“controlBean”,“isOK”).

to(“x”).end().

pipeline(“b”, “c”, “d”);

A B C D

control

X

Page 7: Apache Camel

Components

Page 8: Apache Camel

Endpoint URI

<component-name>:<component-spec>[?params]

from(“file:/tmp?consumer.delay=1000”)

from(“bean:myBean?methodName=getOrders”)

from(“quickfix-server:server.cfg?log=#loggingFactoryBean”)

Page 9: Apache Camel

Pattern Examples

Page 10: Apache Camel

Content Based Router

Page 11: Apache Camel

Content Based Router

Page 12: Apache Camel

Message Filter

Page 13: Apache Camel

Splitter

Page 14: Apache Camel

Translator

Page 15: Apache Camel

Aggregator

Page 16: Apache Camel

Resequencer

reliable delivery!

Page 17: Apache Camel

Routing Slip

Page 18: Apache Camel
Page 19: Apache Camel

Quick Start

java –cp … org.apache.camel.spring.Main

Page 20: Apache Camel
Page 21: Apache Camel

RandomFeatures

Page 22: Apache Camel

Error Handling

Page 23: Apache Camel

try … catch … finally

Page 24: Apache Camel

Message-Driven POJO

Page 25: Apache Camel

Camel & ActiveMQ

${ACTIVEMQ_HOME}/conf/activemq.xml

<camelContext id=“camel”

xmlns=“http://camel.apache.org/schema/spring”>

<route>

<!-- you can add routes here -->

</route>

</camelContext>

Page 26: Apache Camel

http://camel.apache.org