Apache Camel for Devclub.eu

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

description

apache camel, devclub.eu

Transcript of Apache Camel for Devclub.eu

Page 1: Apache Camel for Devclub.eu

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

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

Page 2: Apache Camel for Devclub.eu
Page 3: Apache Camel for Devclub.eu

SOA: Spaghetti-Oriented Architecture

Page 4: Apache Camel for Devclub.eu

http://camel.apache.org

What is Apache Camel?

Page 5: Apache Camel for Devclub.eu

A B

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

Page 6: Apache Camel for Devclub.eu

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

method(“controlBean”,“isOK”).

to(“x”).end().

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

A B C D

control

X

Page 7: Apache Camel for Devclub.eu

Components

Page 8: Apache Camel for Devclub.eu

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 for Devclub.eu

Pattern Examples

Page 10: Apache Camel for Devclub.eu

Content Based Router

Page 11: Apache Camel for Devclub.eu

Content Based Router

Page 12: Apache Camel for Devclub.eu

Message Filter

Page 13: Apache Camel for Devclub.eu

Splitter

Page 14: Apache Camel for Devclub.eu

Translator

Page 15: Apache Camel for Devclub.eu

Aggregator

Page 16: Apache Camel for Devclub.eu

Resequencer

reliable delivery!

Page 17: Apache Camel for Devclub.eu

Routing Slip

Page 18: Apache Camel for Devclub.eu
Page 19: Apache Camel for Devclub.eu

Quick Start

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

Page 20: Apache Camel for Devclub.eu
Page 21: Apache Camel for Devclub.eu

RandomFeatures

Page 22: Apache Camel for Devclub.eu

Error Handling

Page 23: Apache Camel for Devclub.eu

try … catch … finally

Page 24: Apache Camel for Devclub.eu

Message-Driven POJO

Page 25: Apache Camel for Devclub.eu

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 for Devclub.eu

http://camel.apache.org