The session is about the significance of Camel and using Camel with Event Driven Architectures. It will give an overview of Apache Camel and showcase different types of EDA patterns that can be implemented with Camel.
1. Introduction
An introduction to Enterprise Application Integration and Apache Camel
Camel as a Chamelion: An introduction to the simplicity of Camel
Some interesting components: twitter, aws-sqs, mongodb, web-sockets, camel-extra
2. Event Driven Architectures with Camel
What and why of EDA
EDA within Camel using SEDA
Deployment architectures: Camel as a participant of EDA
Actor Model using Camel
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
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
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
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