SlideShare a Scribd company logo
Implementing Enterprise Integration
     Patterns through Apache Camel




    Andrea Leoncini, Red Hat
     1

lunedì 18 febbraio 13
Your speaker today


      Andrea Leoncini
            • andrea.leoncini@redhat.com
            • twitter: @leopericoli
      Senior Middleware Solution Architect at Red Hat
            • leaders in open source middleware & integration
            • we provide training, consulting, support, distributions & tools for open
              source integration software
      In the community
            •      co-founder of JUG Roma
            •      co-founder of JBUG Roma, JBUG Milano
            •      andrea.leoncini @JBoss Community
            •      pride founder of JBoss Consulting Team in Italy




      2         Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
What are Enterprise Integration Patterns?




      3      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Book by Gregor & Bobby!




      4      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
A selection of some of the patterns...




      5      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
What is Apache Camel?


                                                        http://camel.apache.org/




      6      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
What is Apache Camel?




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

           http://camel.apache.org/enterprise-integration-patterns.html



      7      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Lets look at a pattern!




      8      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter




      9      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : XML




             <camelContext xmlns="http://camel.apache.org/schema/spring">
               <route>
                 <from uri="activemq:topic:Quotes"/>
                 <filter>
                   <xpath>/quote/product = ‘widget’</xpath>
                   <to uri="mqseries:WidgetQuotes"/>
                 </filter>
               </route>
             </camelContext>




     10      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : Spring XML


          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns="http://www.springframework.org/schema/beans"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://www.springframework.org/schema/beans
                 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                 http://camel.apache.org/schema/spring
                 http://camel.apache.org/schema/spring/camel-spring.xsd">

           <camelContext xmlns="http://camel.apache.org/schema/spring">
              <route>
                <from uri="activemq:topic:Quotes"/>
                <filter>
                  <xpath>/quote/product = ‘widget’</xpath>
                  <to uri="mqseries:WidgetQuotes"/>
                </filter>
              </route>
            </camelContext>

          </beans>



     11      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : XML




             <camelContext xmlns="http://camel.apache.org/schema/spring">
               <route>
                 <from uri="activemq:topic:Quotes"/>
                 <filter>
                   <xpath>/quote/product = ‘widget’</xpath>
                   <to uri="mqseries:WidgetQuotes"/>
                 </filter>
               </route>
             </camelContext>




     12      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Expressions & Predicates



            15 Expression
            Languages                                              BeanShell    Python
                                                                       EL        Ruby
                                                                     Groovy     Simple
                                                                   JavaScript    SpEL
                                                                    JSR 223       SQL
                                                                     OGNL        XPath
                                                                     MVEL       XQuery
                                                                      PHP

     13      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
URIs, Endpoints and Components (120+)


                              http://camel.apache.org/components.html

                         activemq                                  cxf       flatpack        jasypt
                   activemq-journal                                cxfrs   freemarker      javaspace
                            amqp                              dataset      ftp/ftps/sftp      jbi
                             atom                              db4o            gae            jcr
                             bean                              direct          hdfs          jdbc
                    bean validation                                ejb      hibernate        jetty
                           browse                              esper           hl7           jms
                             cache                             event           http          jmx
                           cometd                                  exec       ibatis          jpa
                            crypto                                  file         irc         jt/400



     14      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
120+ components...


                           language                        properties          seda               stream

                               ldap                            quartz         servlet         string-template

                      mail/imap/pop3                          quickfix           sip                test

                               mina                                ref       smooks                timer

                              mock                             restlet         smpp             validation

                                msv                                rmi         snmp              velocity

                             nagios                                rnc   spring-integration         vm

                               netty                               rng    spring-security         xmpp

                                nmr                                rss      spring-ws             xquery

                              printer                         scalate           sql                xslt




     15      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : XML




             <camelContext xmlns="http://camel.apache.org/schema/spring">
               <route>
                 <from uri="activemq:topic:Quotes"/>
                 <filter>
                   <xpath>/quote/product = ‘widget’</xpath>
                   <to uri="mqseries:WidgetQuotes"/>
                 </filter>
               </route>
             </camelContext>




     16      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : Java




      from("activemq:topic:Quotes”).
        filter().xpath("/quote/product = ‘widget’").
          to("mqseries:WidgetQuotes");




     17      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : Java Complete



     package com.acme.quotes;

     import org.apache.camel.builder.RouteBuilder;

     public class MyRouteBuilder extends RouteBuilder {

              public void configure() {

                        // forward widget quotes to MQSeries
                        from("activemq:topic:Quotes”).
                                filter().xpath("/quote/product = ‘widget’").
                                to("mqseries:WidgetQuotes");
            }
     }


     18      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Message Filter : Scala




                   "direct:a" when(_.in == "<hello/>") {
                       to("mock:a")
                   }




     19      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Create CamelContext in Spring




    <camelContext xmlns="http://camel.apache.org/schema/spring">
      <package>com.acme.quotes</package>
    </camelContext>




     20      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Create CamelContext in Java




           CamelContext context = new DefaultCamelContext();
           context.addRoutes(new MyRouteBuilder());
           context.start();




     21      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
IDE support




             Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
IDE support (XML)




     23      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Recap - core concepts of Camel


         Enterprise Integration Patterns
         Routing
         Domain Specific Language (DSL)
         Endpoints & URIs
         Predicates & Expressions
         Components (lots of ‘em!)
         Test Kit
     
                    and much more ...




     24      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Beans




     25      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Bean as a Message Translator




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




     26      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Bean




     public class Foo {

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




     27      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Binding Beans to Camel Endpoints




          public class Foo {

               @Consume(uri="activemq:cheese")
               public Object onCheese(String name) {
                 ...
               }
          }



     28       Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Binding Method Arguments




          public class Foo {

               public Object onCheese(
                 @XPath("/foo/bar") String name,
                 @Header("JMSCorrelationID") String id) {
                 ...
               }
          }
                           for more annotations see
                           http://camel.apache.org/bean-integration.html


     29       Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Sending messages to endpoints




  public class Foo {
    @Produce(uri="activemq:foo.bar")
    ProducerTemplate producer;

          public void doSomething() {
            if (whatever) {
              producer.sendBody("<hello>world!</hello>");
            }
          }
  }


     30      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Sending messages to endpoints



    public interface MyListener {
        String sayHello(String name);
    }

    public class MyBean {
        @Produce(uri = "activemq:foo")
        protected MyListener producer;

              public void doSomething() {
                  // lets send a message
                  String response = producer.sayHello("James");
              }
    }

     31      Copyright © 2013 Red Hat, Inc. All rights reserved.

lunedì 18 febbraio 13
Ad

More Related Content

What's hot (20)

Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
Marcelo Jabali
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
bobmcwhirter
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
bobmcwhirter
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
Dima Gomaa
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
daoswald
 
Hybrid Applications
Hybrid ApplicationsHybrid Applications
Hybrid Applications
Andreas Enbohm
 
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 Features
Andreas Enbohm
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter
 
Scala
ScalaScala
Scala
Andreas Enbohm
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
tobiascrawley
 
When Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of TorqueboxWhen Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of Torquebox
rockyjaiswal
 
Fluentd in Co-Work
Fluentd in Co-WorkFluentd in Co-Work
Fluentd in Co-Work
Makoto Haruyama
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
mfrancis
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
guest1f2740
 
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Treasure Data, Inc.
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
Bruno Oliveira
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
wensheng wei
 
Php version 5
Php version 5Php version 5
Php version 5
Manuel Rodriguez
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
Ford AntiTrust
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
Fabio Akita
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
Marcelo Jabali
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
bobmcwhirter
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
bobmcwhirter
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
Dima Gomaa
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
daoswald
 
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 Features
Andreas Enbohm
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter
 
When Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of TorqueboxWhen Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of Torquebox
rockyjaiswal
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
mfrancis
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
guest1f2740
 
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
Treasure Data, Inc.
 
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e RubyTorqueBox - Ultrapassando a fronteira entre Java e Ruby
TorqueBox - Ultrapassando a fronteira entre Java e Ruby
Bruno Oliveira
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
wensheng wei
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
Ford AntiTrust
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
Fabio Akita
 

Similar to Camel and JBoss (20)

Camel overview
Camel overview Camel overview
Camel overview
James Strachan
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDE
JBUG London
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
FuseSource.com
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
Luciano Resende
 
20160908 hivemall meetup
20160908 hivemall meetup20160908 hivemall meetup
20160908 hivemall meetup
Takeshi Yamamuro
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
Fabio Akita
 
What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24
Jim Jagielski
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
Amol Pujari
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
Stoyan Zhekov
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
Joe Kutner
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
Claus Ibsen
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
Claus Ibsen
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
Martin Jackson
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012
Olivier MJ Crépin-Leblond
 
apachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdfapachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdf
ssuserbb9f511
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
Konrad Malawski
 
44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON London 2015 - Going AUTH the Rails on a Crazy Train44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
Jesse Vincent
 
Scalding - Big Data Programming with Scala
Scalding - Big Data Programming with ScalaScalding - Big Data Programming with Scala
Scalding - Big Data Programming with Scala
Taewook Eom
 
Enterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQEnterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQ
elliando dias
 
Easy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDEEasy Integration with Apache Camel and Fuse IDE
Easy Integration with Apache Camel and Fuse IDE
JBUG London
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
FuseSource.com
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
Luciano Resende
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
Fabio Akita
 
What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24What's New and Newer in Apache httpd-24
What's New and Newer in Apache httpd-24
Jim Jagielski
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
Stoyan Zhekov
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
Joe Kutner
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
Claus Ibsen
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
Claus Ibsen
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
Martin Jackson
 
IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012IPv6 Matrix presentation for World IPv6 Launch, June 2012
IPv6 Matrix presentation for World IPv6 Launch, June 2012
Olivier MJ Crépin-Leblond
 
apachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdfapachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdf
ssuserbb9f511
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
Konrad Malawski
 
44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON London 2015 - Going AUTH the Rails on a Crazy Train44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON London 2015 - Going AUTH the Rails on a Crazy Train
44CON
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
Jesse Vincent
 
Scalding - Big Data Programming with Scala
Scalding - Big Data Programming with ScalaScalding - Big Data Programming with Scala
Scalding - Big Data Programming with Scala
Taewook Eom
 
Enterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQEnterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQ
elliando dias
 
Ad

More from JBug Italy (20)

JBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testing
JBug Italy
 
AS7 and CLI
AS7 and CLIAS7 and CLI
AS7 and CLI
JBug Italy
 
Intro jbug milano_26_set2012
Intro jbug milano_26_set2012Intro jbug milano_26_set2012
Intro jbug milano_26_set2012
JBug Italy
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
JBug Italy
 
AS7
AS7AS7
AS7
JBug Italy
 
JBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logic
JBug Italy
 
JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 Overview
JBug Italy
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
JBug Italy
 
JBoss AS7 Webservices
JBoss AS7 WebservicesJBoss AS7 Webservices
JBoss AS7 Webservices
JBug Italy
 
JBoss AS7
JBoss AS7JBoss AS7
JBoss AS7
JBug Italy
 
Intro JBug Milano - September 2011
Intro JBug Milano - September 2011Intro JBug Milano - September 2011
Intro JBug Milano - September 2011
JBug Italy
 
All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMS
JBug Italy
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
JBug Italy
 
Drools Introduction
Drools IntroductionDrools Introduction
Drools Introduction
JBug Italy
 
September 2010 - Arquillian
September 2010 - ArquillianSeptember 2010 - Arquillian
September 2010 - Arquillian
JBug Italy
 
September 2010 - Gatein
September 2010 - GateinSeptember 2010 - Gatein
September 2010 - Gatein
JBug Italy
 
May 2010 - Infinispan
May 2010 - InfinispanMay 2010 - Infinispan
May 2010 - Infinispan
JBug Italy
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
JBug Italy
 
May 2010 - Drools flow
May 2010 - Drools flowMay 2010 - Drools flow
May 2010 - Drools flow
JBug Italy
 
May 2010 - Hibernate search
May 2010 - Hibernate searchMay 2010 - Hibernate search
May 2010 - Hibernate search
JBug Italy
 
JBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testing
JBug Italy
 
Intro jbug milano_26_set2012
Intro jbug milano_26_set2012Intro jbug milano_26_set2012
Intro jbug milano_26_set2012
JBug Italy
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
JBug Italy
 
JBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logic
JBug Italy
 
JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 Overview
JBug Italy
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
JBug Italy
 
JBoss AS7 Webservices
JBoss AS7 WebservicesJBoss AS7 Webservices
JBoss AS7 Webservices
JBug Italy
 
Intro JBug Milano - September 2011
Intro JBug Milano - September 2011Intro JBug Milano - September 2011
Intro JBug Milano - September 2011
JBug Italy
 
All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMS
JBug Italy
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
JBug Italy
 
Drools Introduction
Drools IntroductionDrools Introduction
Drools Introduction
JBug Italy
 
September 2010 - Arquillian
September 2010 - ArquillianSeptember 2010 - Arquillian
September 2010 - Arquillian
JBug Italy
 
September 2010 - Gatein
September 2010 - GateinSeptember 2010 - Gatein
September 2010 - Gatein
JBug Italy
 
May 2010 - Infinispan
May 2010 - InfinispanMay 2010 - Infinispan
May 2010 - Infinispan
JBug Italy
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
JBug Italy
 
May 2010 - Drools flow
May 2010 - Drools flowMay 2010 - Drools flow
May 2010 - Drools flow
JBug Italy
 
May 2010 - Hibernate search
May 2010 - Hibernate searchMay 2010 - Hibernate search
May 2010 - Hibernate search
JBug Italy
 
Ad

Recently uploaded (20)

The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 

Camel and JBoss

  • 1. Implementing Enterprise Integration Patterns through Apache Camel Andrea Leoncini, Red Hat 1 lunedì 18 febbraio 13
  • 2. Your speaker today  Andrea Leoncini • [email protected] • twitter: @leopericoli  Senior Middleware Solution Architect at Red Hat • leaders in open source middleware & integration • we provide training, consulting, support, distributions & tools for open source integration software  In the community • co-founder of JUG Roma • co-founder of JBUG Roma, JBUG Milano • andrea.leoncini @JBoss Community • pride founder of JBoss Consulting Team in Italy 2 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 3. What are Enterprise Integration Patterns? 3 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 4. Book by Gregor & Bobby! 4 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 5. A selection of some of the patterns... 5 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 6. What is Apache Camel? http://camel.apache.org/ 6 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 7. What is Apache Camel? Apache Camel is a Powerful Open Source Integration Framework based on known Enterprise Integration Patterns http://camel.apache.org/enterprise-integration-patterns.html 7 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 8. Lets look at a pattern! 8 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 9. Message Filter 9 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 10. Message Filter : XML <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:topic:Quotes"/> <filter> <xpath>/quote/product = ‘widget’</xpath> <to uri="mqseries:WidgetQuotes"/> </filter> </route> </camelContext> 10 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 11. Message Filter : Spring XML <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:topic:Quotes"/> <filter> <xpath>/quote/product = ‘widget’</xpath> <to uri="mqseries:WidgetQuotes"/> </filter> </route> </camelContext> </beans> 11 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 12. Message Filter : XML <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:topic:Quotes"/> <filter> <xpath>/quote/product = ‘widget’</xpath> <to uri="mqseries:WidgetQuotes"/> </filter> </route> </camelContext> 12 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 13. Expressions & Predicates 15 Expression Languages BeanShell Python EL Ruby Groovy Simple JavaScript SpEL JSR 223 SQL OGNL XPath MVEL XQuery PHP 13 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 14. URIs, Endpoints and Components (120+) http://camel.apache.org/components.html activemq cxf flatpack jasypt activemq-journal cxfrs freemarker javaspace amqp dataset ftp/ftps/sftp jbi atom db4o gae jcr bean direct hdfs jdbc bean validation ejb hibernate jetty browse esper hl7 jms cache event http jmx cometd exec ibatis jpa crypto file irc jt/400 14 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 15. 120+ components... language properties seda stream ldap quartz servlet string-template mail/imap/pop3 quickfix sip test mina ref smooks timer mock restlet smpp validation msv rmi snmp velocity nagios rnc spring-integration vm netty rng spring-security xmpp nmr rss spring-ws xquery printer scalate sql xslt 15 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 16. Message Filter : XML <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:topic:Quotes"/> <filter> <xpath>/quote/product = ‘widget’</xpath> <to uri="mqseries:WidgetQuotes"/> </filter> </route> </camelContext> 16 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 17. Message Filter : Java from("activemq:topic:Quotes”). filter().xpath("/quote/product = ‘widget’"). to("mqseries:WidgetQuotes"); 17 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 18. Message Filter : Java Complete package com.acme.quotes; import org.apache.camel.builder.RouteBuilder; public class MyRouteBuilder extends RouteBuilder { public void configure() { // forward widget quotes to MQSeries from("activemq:topic:Quotes”). filter().xpath("/quote/product = ‘widget’"). to("mqseries:WidgetQuotes"); } } 18 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 19. Message Filter : Scala "direct:a" when(_.in == "<hello/>") { to("mock:a") } 19 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 20. Create CamelContext in Spring <camelContext xmlns="http://camel.apache.org/schema/spring"> <package>com.acme.quotes</package> </camelContext> 20 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 21. Create CamelContext in Java CamelContext context = new DefaultCamelContext(); context.addRoutes(new MyRouteBuilder()); context.start(); 21 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 22. IDE support Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 23. IDE support (XML) 23 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 24. Recap - core concepts of Camel  Enterprise Integration Patterns  Routing  Domain Specific Language (DSL)  Endpoints & URIs  Predicates & Expressions  Components (lots of ‘em!)  Test Kit  and much more ... 24 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 25. Beans 25 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 26. Bean as a Message Translator from("activemq:Incoming”). beanRef("myBeanName”, “someMethod"). to("activemq:Outgoing"); 26 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 27. Bean public class Foo { public String someMethod(String name) { return “Hello “ + name; } } 27 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 28. Binding Beans to Camel Endpoints public class Foo { @Consume(uri="activemq:cheese") public Object onCheese(String name) { ... } } 28 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 29. Binding Method Arguments public class Foo { public Object onCheese( @XPath("/foo/bar") String name, @Header("JMSCorrelationID") String id) { ... } } for more annotations see http://camel.apache.org/bean-integration.html 29 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 30. Sending messages to endpoints public class Foo { @Produce(uri="activemq:foo.bar") ProducerTemplate producer; public void doSomething() { if (whatever) { producer.sendBody("<hello>world!</hello>"); } } } 30 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13
  • 31. Sending messages to endpoints public interface MyListener { String sayHello(String name); } public class MyBean { @Produce(uri = "activemq:foo") protected MyListener producer; public void doSomething() { // lets send a message String response = producer.sayHello("James"); } } 31 Copyright © 2013 Red Hat, Inc. All rights reserved. lunedì 18 febbraio 13