SlideShare a Scribd company logo
1 of 35
Download to read offline
1
Event Driven Architectures
                        with

                   Camel
Gnanaguru Sattanathan           Prajod Vettiyattil
 Twitter:@gnanagurus           Twitter: @prajods
Website: bushorn.com




2
What this session is about


Application Integration

Apache Camel

Event Driven Architectures with Camel



3
Application Integration



4
Integration
                       JMS,
                                  1. Validate, Enrich, Route,
                       RMI,          Transform
                      JDBC,       2. Diverse protocol support
                       FTP,
                      SNMP,
                       TCP



                              Middleware


                                            https,
                                            SFTP,
                                           SNMP,
    1. Enterprise Service Bus               TCP,
                                           CORBA
    2. Integration Framework

5
The Chameleon



6
Camel is a reptile !




7
The Chameleon
It can change color with the container 



Camel     Camel      Camel     Camel       Camel    Camel

                                           Oracle
JVM       Tomcat     JBoss   Websphere              Jetty
                                           Fusion




8
Apache Camel
•   Integration framework
•   Multiple deployment options
•   Feature rich
•   Simple to program
•   Unique scalability features
•   Apache License



9
Apache Camel: Components
• More than 100 readymade components
• Covering
  – PaaS & Public Clouds
  – Social Networks
  – Devices
  – Almost all standard protocols



10
Apache Camel: Components
      AWS       HDFS         MongoDB         ActiveMQ       Twitter

FILE        JDBC        JMS        SFTP          Streams      JGroups

AMQP        MQTT       NETTY           SQL          SIP          UDP

Cache       Esper      Hazelcast        Zoo Keeper         WebSockets


SMTP        SSH         SMPP       SOLR             RMI       Velocity

       Smooks       XQuery      XSLT          NMR          TCP


 11
Coding with Camel



12
Camel – Code your way

                             JAVA


 Domain Specific Language   SPRING
          (DSL)
                            GROOVY

                            SCALA



13
A simple file integration

       File


                  File System


       Input                     Output
     Directory                  Directory




14
Simple file integration:
              Sample Code

     <route>
         <from uri="file://d:Input"/>
         <to uri="file://d:Output"/>
     </route>
     using Spring XML


15
File System – Message Broker
               Integration
        File


     File System          Message Broker
                           ( ActiveMQ)

       Input                 Output
     Directory               Queue




16
File System to Message Broker Integration:
                    Sample Code

<route>
    <from uri="file://d:Input"/>
    <to uri="activemq:queue:Output"/>
</route>
 using Spring XML


  17
Adding a simple transformation

        File




                   Transformer
     File System                 Message Broker
                                  ( ActiveMQ)

       Input                       Output
     Directory                     Queue




18
A simple transformation:
                   Sample Code

<route>
    <from uri="file://d:Input"/>
    <to uri="xslt:file://d:transform.xsl"/>
    <to uri="activemq:queue:Output"/>
</route>
  using Spring XML

   19
A simple Twitter application


 Twitter.com                Message Broker
                             ( ActiveMQ)

       Tweets                 Tweets
     Tweets
                              Queue




20
A simple Twitter application:
              Sample Code

<route>
    <from uri="twitter://search
              ?type=direct
              &keywords=JUDCON”/>
    <to uri="activemq:queue:Output"/>
</route>
  21
Event Driven Architectures
            with
          Camel


22
Event Driven Architecture

•    EDA
•    A software architecture pattern
•    Event: Significant change in state
•    Parts of the architecture
     – Event source
     – Event channel
     – Event processor




23
EDA
Sources




                  Source     Source      Source       Source      Source     Source
                    1          2           3            4           5          6
Channels
Processors




                             Event             Event             Event
                           Processor 1       Processor 2       Processor 3


             24
Staged
Event Driven Architecture(SEDA)

• EDA
     – Direct and tight coupling of sources and
       processors
     – Event processor may get swamped with events
        • Reduces performance
        • Possible loss of messages
• SEDA
     – EDA decomposed into stages and connected with
       queues


25
SEDA: one view
Stage 1




                             Source     Source      Source           Source         Source   Source
                               1          2           3                4              5        6
Channels using Queues




                                                      Channels
Stage 2




                                         Event            Event                  Event
                                      Processor 1      Processor 2            Processor 3



                        26
SEDA: another view
                                                             Processor
                                               Queue             2
     Source
       1

                                Processor
                   Queue            1


     Source
       2                                                     Processor
                                               Queue             3




     Stage 1   Channels using   Stage 2     Channels using   Stage 3
                  Queues                       Queues




27
SEDA with Camel
• SEDA
     –   Scalability feature in Camel
     –   Uses thread pools and internal queues
     –   Enables parallel processing
     –   Avoids waiting threads




28
Camel with SEDA: comparison
         Waiting thread without SEDA                                    Parallel processing with SEDA




                                                    Thread 1
                      Receive                                         Receive




                                                                                                          Thread 2
                                                                                SEDA Queue 1
                      Validate
                                                                                               Validate
         Thread 1




                    Normalize
                                                                     Normalize
                       Enrich
                                                                                SEDA Queue 2


                        Split                                           Split                   Enrich




                                                                                                          Thread 3
                       Route                                           Route

•   Impact                                     •   For 100 concurrent requests
     –       significant reduction in thread        –          Without SEDA: 100 threads; With SEDA: 30 threads
    29       consumption
Camel as a part of EDA
• Camel as
     – Event channel
     – Event processor




            Camel




30
Camel as Event Channel
•    SEDA queues
•    VM queues
•    Multi-threaded flow
•    Load balanced flow
•    Asynchronous API




31
Camel as Event Processor
•    Not ideal as the final Event Processor
•    Can be used as an intermediate Event processor
•    Routing based on events
•    Transformation of events
•    Combining simple events
•    Event auditing, logging




32
Camel and the Actor Model
                          with Akka
• Actor Model
                                                           Actor
     – Actors
                                                           Behavior
          • Similar to objects, many other features
          • Mailbox, behavior/s, internal state       Mailbox         State
     –   No shared state
     –   Messages between actors
     –   Locking and Threads are abstracted
     –   Each actor instance runs in its own thread
• Akka-Camel
     – Integrate Akka to other applications
     – Two way: Akka to Camel and Camel to Akka

33
Summary
• Camel
     – Integration Framework
     – Simplicity and flexibility
     – Components
• EDA with Camel
     – SEDA
     – SEDA within Camel
     – Camel as part of SEDA
• Akka and Camel for EDA


34
Questions

Gnanaguru Sattanathan                    Prajod Vettiyattil
 Twitter:@gnanagurus                    Twitter: @prajods
Website: bushorn.com




      Our Open Source Middleware Group on LinkedIn
                http://tinyurl.com/be6e93q




35

More Related Content

What's hot

Akka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaAkka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaMark Harrison
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryJeff Potts
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka StreamsJohan Andrén
 
Pulsarctl & Pulsar Manager
Pulsarctl & Pulsar ManagerPulsarctl & Pulsar Manager
Pulsarctl & Pulsar ManagerStreamNative
 
High Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance TuningHigh Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance TuningAlbert Chen
 
Alfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackAlfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackCesar Capillas
 
Camel riders in the cloud
Camel riders in the cloudCamel riders in the cloud
Camel riders in the cloudClaus Ibsen
 
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...confluent
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsJohan Andrén
 
Kafka elastic search meetup 09242018
Kafka elastic search meetup 09242018Kafka elastic search meetup 09242018
Kafka elastic search meetup 09242018Ying Xu
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectSencha
 
Bulk Export Tool for Alfresco
Bulk Export Tool for AlfrescoBulk Export Tool for Alfresco
Bulk Export Tool for AlfrescoRichard McKnight
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesJeff Potts
 
3.2 Streaming and Messaging
3.2 Streaming and Messaging3.2 Streaming and Messaging
3.2 Streaming and Messaging振东 刘
 
Double Sync Replication
Double Sync ReplicationDouble Sync Replication
Double Sync ReplicationLixun Peng
 
Coordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractCoordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractOmri Spector
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka StreamsKonrad Malawski
 

What's hot (20)

Akka Streams - From Zero to Kafka
Akka Streams - From Zero to KafkaAkka Streams - From Zero to Kafka
Akka Streams - From Zero to Kafka
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
 
Pulsarctl & Pulsar Manager
Pulsarctl & Pulsar ManagerPulsarctl & Pulsar Manager
Pulsarctl & Pulsar Manager
 
High Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance TuningHigh Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance Tuning
 
Alfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackAlfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stack
 
Camel riders in the cloud
Camel riders in the cloudCamel riders in the cloud
Camel riders in the cloud
 
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...
Discover Kafka on OpenShift: Processing Real-Time Financial Events at Scale (...
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
 
Kafka elastic search meetup 09242018
Kafka elastic search meetup 09242018Kafka elastic search meetup 09242018
Kafka elastic search meetup 09242018
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Time Machine
Time MachineTime Machine
Time Machine
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and Direct
 
Bulk Export Tool for Alfresco
Bulk Export Tool for AlfrescoBulk Export Tool for Alfresco
Bulk Export Tool for Alfresco
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to Microservices
 
3.2 Streaming and Messaging
3.2 Streaming and Messaging3.2 Streaming and Messaging
3.2 Streaming and Messaging
 
Double Sync Replication
Double Sync ReplicationDouble Sync Replication
Double Sync Replication
 
Coordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractCoordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud Contract
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka Streams
 

Similar to Event Driven Architectures with Camel

Architectures with Windows Azure
Architectures with Windows AzureArchitectures with Windows Azure
Architectures with Windows AzureDamir Dobric
 
Leveraging Open Source Integration with WSO2 Enterprise Service Bus
Leveraging Open Source Integration with WSO2 Enterprise Service BusLeveraging Open Source Integration with WSO2 Enterprise Service Bus
Leveraging Open Source Integration with WSO2 Enterprise Service BusWSO2
 
Solr Compute Cloud - An Elastic SolrCloud Infrastructure
Solr Compute Cloud - An Elastic SolrCloud Infrastructure Solr Compute Cloud - An Elastic SolrCloud Infrastructure
Solr Compute Cloud - An Elastic SolrCloud Infrastructure Nitin S
 
Solr Lucene Conference 2014 - Nitin Presentation
Solr Lucene Conference 2014 - Nitin PresentationSolr Lucene Conference 2014 - Nitin Presentation
Solr Lucene Conference 2014 - Nitin PresentationNitin Sharma
 
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...Lucidworks
 
World of Tanks Experience of Using Kafka
World of Tanks Experience of Using KafkaWorld of Tanks Experience of Using Kafka
World of Tanks Experience of Using KafkaLevon Avakyan
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js ExplainedJeff Kunkle
 
Bloomreach - BloomStore Compute Cloud Infrastructure
Bloomreach - BloomStore Compute Cloud Infrastructure Bloomreach - BloomStore Compute Cloud Infrastructure
Bloomreach - BloomStore Compute Cloud Infrastructure bloomreacheng
 
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)BIOVIA
 
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARNKafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARNDataWorks Summit
 
TS 4839 - Enterprise Integration Patterns in Practice
TS 4839 - Enterprise Integration Patterns in PracticeTS 4839 - Enterprise Integration Patterns in Practice
TS 4839 - Enterprise Integration Patterns in Practiceaegloff
 
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015Robert Metzger
 
Open Source Integration with WSO2 Enterprise Service Bus
Open Source Integration  with  WSO2 Enterprise Service BusOpen Source Integration  with  WSO2 Enterprise Service Bus
Open Source Integration with WSO2 Enterprise Service Bussumedha.r
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Raymond Roestenburg
 
Apache Zeppelin & Cluster
Apache Zeppelin & ClusterApache Zeppelin & Cluster
Apache Zeppelin & ClusterJongyoul Lee
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...netvis
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...DataWorks Summit
 
Chicago Flink Meetup: Flink's streaming architecture
Chicago Flink Meetup: Flink's streaming architectureChicago Flink Meetup: Flink's streaming architecture
Chicago Flink Meetup: Flink's streaming architectureRobert Metzger
 
Integrating OpenStack to Existing infrastructure
Integrating OpenStack to Existing infrastructureIntegrating OpenStack to Existing infrastructure
Integrating OpenStack to Existing infrastructurelaurabeckcahoon
 

Similar to Event Driven Architectures with Camel (20)

Architectures with Windows Azure
Architectures with Windows AzureArchitectures with Windows Azure
Architectures with Windows Azure
 
Leveraging Open Source Integration with WSO2 Enterprise Service Bus
Leveraging Open Source Integration with WSO2 Enterprise Service BusLeveraging Open Source Integration with WSO2 Enterprise Service Bus
Leveraging Open Source Integration with WSO2 Enterprise Service Bus
 
mg-ccr-ws-10122008
mg-ccr-ws-10122008mg-ccr-ws-10122008
mg-ccr-ws-10122008
 
Solr Compute Cloud - An Elastic SolrCloud Infrastructure
Solr Compute Cloud - An Elastic SolrCloud Infrastructure Solr Compute Cloud - An Elastic SolrCloud Infrastructure
Solr Compute Cloud - An Elastic SolrCloud Infrastructure
 
Solr Lucene Conference 2014 - Nitin Presentation
Solr Lucene Conference 2014 - Nitin PresentationSolr Lucene Conference 2014 - Nitin Presentation
Solr Lucene Conference 2014 - Nitin Presentation
 
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...
Solr Compute Cloud – An Elastic Solr Infrastructure: Presented by Nitin Sharm...
 
World of Tanks Experience of Using Kafka
World of Tanks Experience of Using KafkaWorld of Tanks Experience of Using Kafka
World of Tanks Experience of Using Kafka
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js Explained
 
Bloomreach - BloomStore Compute Cloud Infrastructure
Bloomreach - BloomStore Compute Cloud Infrastructure Bloomreach - BloomStore Compute Cloud Infrastructure
Bloomreach - BloomStore Compute Cloud Infrastructure
 
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
 
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARNKafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
 
TS 4839 - Enterprise Integration Patterns in Practice
TS 4839 - Enterprise Integration Patterns in PracticeTS 4839 - Enterprise Integration Patterns in Practice
TS 4839 - Enterprise Integration Patterns in Practice
 
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
Architecture of Flink's Streaming Runtime @ ApacheCon EU 2015
 
Open Source Integration with WSO2 Enterprise Service Bus
Open Source Integration  with  WSO2 Enterprise Service BusOpen Source Integration  with  WSO2 Enterprise Service Bus
Open Source Integration with WSO2 Enterprise Service Bus
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011
 
Apache Zeppelin & Cluster
Apache Zeppelin & ClusterApache Zeppelin & Cluster
Apache Zeppelin & Cluster
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
 
Chicago Flink Meetup: Flink's streaming architecture
Chicago Flink Meetup: Flink's streaming architectureChicago Flink Meetup: Flink's streaming architecture
Chicago Flink Meetup: Flink's streaming architecture
 
Integrating OpenStack to Existing infrastructure
Integrating OpenStack to Existing infrastructureIntegrating OpenStack to Existing infrastructure
Integrating OpenStack to Existing infrastructure
 

Event Driven Architectures with Camel

  • 1. 1
  • 2. Event Driven Architectures with Camel Gnanaguru Sattanathan Prajod Vettiyattil Twitter:@gnanagurus Twitter: @prajods Website: bushorn.com 2
  • 3. What this session is about Application Integration Apache Camel Event Driven Architectures with Camel 3
  • 5. Integration JMS, 1. Validate, Enrich, Route, RMI, Transform JDBC, 2. Diverse protocol support FTP, SNMP, TCP Middleware https, SFTP, SNMP, 1. Enterprise Service Bus TCP, CORBA 2. Integration Framework 5
  • 7. Camel is a reptile ! 7
  • 8. The Chameleon It can change color with the container  Camel Camel Camel Camel Camel Camel Oracle JVM Tomcat JBoss Websphere Jetty Fusion 8
  • 9. Apache Camel • Integration framework • Multiple deployment options • Feature rich • Simple to program • Unique scalability features • Apache License 9
  • 10. Apache Camel: Components • More than 100 readymade components • Covering – PaaS & Public Clouds – Social Networks – Devices – Almost all standard protocols 10
  • 11. Apache Camel: Components AWS HDFS MongoDB ActiveMQ Twitter FILE JDBC JMS SFTP Streams JGroups AMQP MQTT NETTY SQL SIP UDP Cache Esper Hazelcast Zoo Keeper WebSockets SMTP SSH SMPP SOLR RMI Velocity Smooks XQuery XSLT NMR TCP 11
  • 13. Camel – Code your way JAVA Domain Specific Language SPRING (DSL) GROOVY SCALA 13
  • 14. A simple file integration File File System Input Output Directory Directory 14
  • 15. Simple file integration: Sample Code <route> <from uri="file://d:Input"/> <to uri="file://d:Output"/> </route> using Spring XML 15
  • 16. File System – Message Broker Integration File File System Message Broker ( ActiveMQ) Input Output Directory Queue 16
  • 17. File System to Message Broker Integration: Sample Code <route> <from uri="file://d:Input"/> <to uri="activemq:queue:Output"/> </route> using Spring XML 17
  • 18. Adding a simple transformation File Transformer File System Message Broker ( ActiveMQ) Input Output Directory Queue 18
  • 19. A simple transformation: Sample Code <route> <from uri="file://d:Input"/> <to uri="xslt:file://d:transform.xsl"/> <to uri="activemq:queue:Output"/> </route> using Spring XML 19
  • 20. A simple Twitter application Twitter.com Message Broker ( ActiveMQ) Tweets Tweets Tweets Queue 20
  • 21. A simple Twitter application: Sample Code <route> <from uri="twitter://search ?type=direct &keywords=JUDCON”/> <to uri="activemq:queue:Output"/> </route> 21
  • 22. Event Driven Architectures with Camel 22
  • 23. Event Driven Architecture • EDA • A software architecture pattern • Event: Significant change in state • Parts of the architecture – Event source – Event channel – Event processor 23
  • 24. EDA Sources Source Source Source Source Source Source 1 2 3 4 5 6 Channels Processors Event Event Event Processor 1 Processor 2 Processor 3 24
  • 25. Staged Event Driven Architecture(SEDA) • EDA – Direct and tight coupling of sources and processors – Event processor may get swamped with events • Reduces performance • Possible loss of messages • SEDA – EDA decomposed into stages and connected with queues 25
  • 26. SEDA: one view Stage 1 Source Source Source Source Source Source 1 2 3 4 5 6 Channels using Queues Channels Stage 2 Event Event Event Processor 1 Processor 2 Processor 3 26
  • 27. SEDA: another view Processor Queue 2 Source 1 Processor Queue 1 Source 2 Processor Queue 3 Stage 1 Channels using Stage 2 Channels using Stage 3 Queues Queues 27
  • 28. SEDA with Camel • SEDA – Scalability feature in Camel – Uses thread pools and internal queues – Enables parallel processing – Avoids waiting threads 28
  • 29. Camel with SEDA: comparison Waiting thread without SEDA Parallel processing with SEDA Thread 1 Receive Receive Thread 2 SEDA Queue 1 Validate Validate Thread 1 Normalize Normalize Enrich SEDA Queue 2 Split Split Enrich Thread 3 Route Route • Impact • For 100 concurrent requests – significant reduction in thread – Without SEDA: 100 threads; With SEDA: 30 threads 29 consumption
  • 30. Camel as a part of EDA • Camel as – Event channel – Event processor Camel 30
  • 31. Camel as Event Channel • SEDA queues • VM queues • Multi-threaded flow • Load balanced flow • Asynchronous API 31
  • 32. Camel as Event Processor • Not ideal as the final Event Processor • Can be used as an intermediate Event processor • Routing based on events • Transformation of events • Combining simple events • Event auditing, logging 32
  • 33. Camel and the Actor Model with Akka • Actor Model Actor – Actors Behavior • Similar to objects, many other features • Mailbox, behavior/s, internal state Mailbox State – No shared state – Messages between actors – Locking and Threads are abstracted – Each actor instance runs in its own thread • Akka-Camel – Integrate Akka to other applications – Two way: Akka to Camel and Camel to Akka 33
  • 34. Summary • Camel – Integration Framework – Simplicity and flexibility – Components • EDA with Camel – SEDA – SEDA within Camel – Camel as part of SEDA • Akka and Camel for EDA 34
  • 35. Questions Gnanaguru Sattanathan Prajod Vettiyattil Twitter:@gnanagurus Twitter: @prajods Website: bushorn.com Our Open Source Middleware Group on LinkedIn http://tinyurl.com/be6e93q 35