20
right © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 1 A Progress Software Company A Progress Software Company Apache Camel Overview Open Source Integration and Messaging Marcelo Jabali Sr. Solutions Consultant Dec., 2011

Apache camel overview dec 2011

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 1 A Progress Software Company

A Progress Software Company

Apache Camel OverviewOpen Source Integration and Messaging

Marcelo JabaliSr. Solutions ConsultantDec., 2011

Page 2: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 2 A Progress Software Company

Agenda

Apache Camel Overview Architecture Routes, Endpoints, Components Deployment Options

Page 3: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 3 A Progress Software Company

About Me

Marcelo JabaliSr. Solutions Consultant

[email protected]

marcelojabali.blogspot.com

mjabali

linkedin.com/in/jabali

Page 4: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 4 A Progress Software Company

Apache Camel

Apache Camel is a powerful Open Source Integration Framework based on known Enterprise Integration Patterns

http://enterpriseintegrationpatterns.com/

Page 5: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 5 A Progress Software Company

Apache Camel - Patterns

50+ Enterprise Integration Patterns

http://camel.apache.org/eip

Page 6: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 6 A Progress Software Company

Apache Camel – Components, Data Formats and Languages

80 Components (activemq, bean, cxf, file, ftp, hibernate, jdbc, ibatis, jms, jetty, mina, netty, timer, xslt, etc) • http://camel.apache.org/components.html

19 Data Formats (csv, serialization, zip, hl7, soap, jaxb, etc)• http://camel.apache.org/data-format.html

15 Expression Languages (EL, Simple, XQuery, Xpath, JavaScript, Ruby, Python, PHP, etc) • http://camel.apache.org/languages.html

Page 7: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 7 A Progress Software Company

Apache Camel - Architecture

Page 8: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 8 A Progress Software Company

What is a Camel Route?

A Route is the step-by-step movement of a message: • From a “listening” endpoint in the role of consumer• Through a processing component - enterprise integration pattern,

processor, interceptor, etc. (optional)• To a target endpoint in the role of producer

May involve any number of processing components that modify the original message and/or redirect it

An application developer specifies routes using:• Spring configuration files• Java Domain Specific Language (DSL)

Page 9: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 9 A Progress Software Company

Apache Camel – DSL (Domain Specific Language)

Camel provides an embedded DSL (in Java, Spring or Scala) for implementing enterprise integration patterns• The DSL uses URIs to define endpoints which are combined to

generate routes (integration flows)

Page 10: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 10 A Progress Software Company

Apache Camel - Components

A Component is essentially a factory of Endpoint instances +80 Components available

activemq cxf rss sql

mail/imap/pop3

cxfrs snmp timer

amqp dataset ftp/ftps/sftp jbi

atom db4o velocity jcr

bean direct restlet jdbc

ldap ejb hibernate jetty

browse xquery hl7 jms

cache quartz http jmx

mock exec ibatis jpa

netty file irc xslt

Page 11: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 11 A Progress Software Company

Apache Camel - Endpoints

An Endpoint is an instance of the component that can create or receive messages, for example, an FTP server, a Web Service, or a JMS broker

Camel allows you to specifiy endpoints using simple URIs• ftp://john@localhost/ftp?password=xxx• activemq:queue:MyQueue

Consumer Processor Producer

FTP JMS

Camel Route

Page 12: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 12 A Progress Software Company

Apache Camel - Consumers and Producers

Message Consumers and Producers are created from endpoints• Some endpoint technologies can create producers and

consumers, others support the creation of either a producer or a consumer

Consumer Processor Producer

FTP JMS

Camel Route

activemq:queue:MyQueue

ftp://john@localhost/ftp?password=xxx

Page 13: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 13 A Progress Software Company

Apache Camel - Sample Route

Typical scenario: "read an XML file from an FTP server, process it using XSLT, and then send it to a JMS queue”• It's natural to consider an FTP consumer that 'consumes' the

message…• … which gets sent to a 'processor' for transformation …• … which gets sent to a JMS message producer for placement on

the queue

Consumer Processor Producer

FTP JMS

Camel Route

Page 14: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 14 A Progress Software Company

Apache Camel – Sample Route

Java DSL from("ftp://john@localhost/ftp?password=xxx") .to("xslt:MyTransform.xslt") .to("activemq:queue:MyQueue")

Consumer Processor Producer

FTP JMS

Camel Route

Page 15: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 15 A Progress Software Company

Apache Camel – Sample Route

Spring XML DSL<camelContext id=“camel”

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

<from uri=“ftp://john@localhost/ftp?password=xxx”/><to uri=“xslt:MyTransform.xslt”/><to uri=“activemq:queue:MyQueue”/>

</route></camelContext>

Clean Integration with Spring Beans<bean id=“activemq”class=“org.apache.activemq.camel.component.ActiveMQComponent”>

<property name=“brokerURL” value=“tcp://localhost:61616”/></bean>

Page 16: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 16 A Progress Software Company

Apache Camel – Spring Bean Integration

Spring Bean as Message Translator

from("activemq:queue:Incoming”). beanRef("myBeanName", "someMethod"). to("activemq:Outgoing");

public class Foo {

public String someMethod(String name) { return “Hello “ + name; }}

Page 17: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 17 A Progress Software Company

Typical Camel Route Development Process

Use a Maven archetype to generate an outline project

Edit the POM to include additional dependencies

Add your Java code into src/main/java, and/or Spring configuration to src/main/resources/META-INF/spring

Add instructions to the Maven Felix plugin, to assist in the generation of OSGi manifest information

Test using the Camel Maven pluginmvn camel:run

Deploy into the Apache ServiceMix OSGi container• Drop into deploy/ directory (pre-production testing)• Install a bundle/feature from a maven repository (production environment)

Page 18: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 18 A Progress Software Company

Camel Testing Options

Test Kit• camel-test JAR (JUnit)• camel-testng JAR (TestNG)• Supports Spring• Easy to test• Quick prototyping

Page 19: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 19 A Progress Software Company

Camel Deployment Options

Deployment Strategy• No Container dependency• Lightweight• Embeddable

Deployment Options• Standalone• WAR• Spring• JEE• OSGi• Cloud

Common Containers

Apache ServiceMixApache ActiveMQApache TomcatJettyJBossIBM WebSphereOracle WebLogicOracle OC4jGlassfishGoogle App EngineAmazon EC2... others

Page 20: Apache camel overview dec 2011

Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. 20 A Progress Software Company

A Progress Software Company

Thanks!

No vendor lock-inFree to redistribute

Enterprise class