enterprise integration patterns with camel

42

Upload: software-infrastructure

Post on 09-Jan-2017

120 views

Category:

Technology


3 download

TRANSCRIPT

Agenda• What is Apache Camel ?

• What is EIP ?

• EIP with Apache Camel

• Example

• Demo

• CamelContext object represents the Camel runtime system.

• Registry: Holds all the bean necessary for routings.

• Exchange: contains message related headers properties.

• TypeConverter:Type conversion utility for converting types.

• Component is a factory for creating Endpoint instances.

• Endpoints implemented with many different communication technologies. • JMS queue

• Web service

• File

• FTP server

• Email Address

Camel Architecture

EIP with Camel

Content Based Router

• Camel supports the message translator using the processor, bean or transform nodes.

Message Filter EIP

• Camel has support for Message Filter using the filter node

from("jms:queue:inbox") .filter(header("test").isNotEqualTo("true")) .to("jms:queue:order");

Recipient List

• How to route messages based on a static or dynamic list of destinations

• Camel has support for Message Filter using the filter node

from("jms:queue:inbox") .multicast().to("file://backup",“seda:inbox");

from("seda:confirmMails").beanRef(processMails) .recipientList(“destinations")

Dynamic Router

from("jms:queue:order") .dynamicRouter(bean(new MyRouter()));

Splitter EIP

• Camel has support for Splitter using the split node

from("file://inbox") .split(body().tokenize("\n")) .to("seda:orderLines");

Aggregator EIP

• Camel has support for Aggregator using the aggregator node

from("jms:topic:stock:quote") .aggregate() .xpath("/quote/@symbol") .batchTimeout(5 * 60 *1000) .to(“seda:quotes");

Resequencer EIP

• Camel has support for Resequencer using the resequence node

from("jms:topic:stock:quote") .resequence().xpath("/quote/@symbol") .timeout(60 * 1000) .to(“seda:quotes");

Dead Letter Channel EIP

Wiretap

from("jms:queue:order") .wireTap("seda:tappedOrder") .to("bean:processOrder");

DEMO