1© 2018 Rogue Wave Software, Inc. All Rights Reserved. 1
Making Camel Work
for You
• Justin Reock
• Sr. Director and Lead Architect
• Rogue Wave OSS Support
2© 2018 Rogue Wave Software, Inc. All Rights Reserved. 2
Who’s speaking to me?
3© 2018 Rogue Wave Software, Inc. All Rights Reserved. 3
Justin Reock
• Sr. Director and Lead Architect of our OSS Support Team
• Way too much experience with ActiveMQ and Camel
• Developed our formal instructor-led training
• Numerous professional services and training engagements
• Early adopter of JMS and Camel
• Major FL/OSS evangelist!
4© 2018 Rogue Wave Software, Inc. All Rights Reserved. 4
What are we going to solve?
5© 2018 Rogue Wave Software, Inc. All Rights Reserved. 5
Quick exercise…
• I’m going to show you three slides
• They all have something in common….
• See if you can figure out what it is!
6© 2018 Rogue Wave Software, Inc. All Rights Reserved. 6
The Chupacabra…
7© 2018 Rogue Wave Software, Inc. All Rights Reserved. 7
A magical unicorn…
8© 2018 Rogue Wave Software, Inc. All Rights Reserved. 8
BillingFulfillment
CRME-Commerce
A homogeneous enterprise
landscape…
9© 2018 Rogue Wave Software, Inc. All Rights Reserved. 9
Answer
 None of these things exist in real life!
10© 2018 Rogue Wave Software, Inc. All Rights Reserved. 10
A Word on ESBs
• An Enterprise Service Bus is an architectural design pattern that
focuses on providing federation between systems using a common
runtime
• Ideally, a Service Bus will provide loosely coupled endpoints to which
various, heterogeneous systems can communicate with one another via
their native frameworks
• So, for instance, a .NET SOAP-driven application should be able to send
data along the bus, which could be received by, say, a Java-based JMS
destination
• The ESB will provide payload and protocol normalization to facilitate
that communication
• Loose coupling will ensure that services can remain unaware of
federated services’ languages and frameworks
11© 2018 Rogue Wave Software, Inc. All Rights Reserved. 11
Examples of ESBs
12© 2018 Rogue Wave Software, Inc. All Rights Reserved. 12
Common Enterprise Architecture Problems
• No Universal Rules and Routing
– Many application frameworks and protocols exist, but they are
fragmented
– They may use different protocols, data formats, and remote
communication methods
• Need for scale
– Business tend to grow their infrastructure and federate more systems
– As they do, the need for better scalability presents itself
• Heterogeneous clients
– Server frameworks aside, the application layer also tends to be highly
fragmented
– You will no doubt have applications in different languages that have a
need to communicate with one another
13© 2018 Rogue Wave Software, Inc. All Rights Reserved. 13
Common problems with ESBs
• Custom Adapters
– When not using something like SOAP, often there is a need to customize
an ESB client to fit into a particular framework
– This refutes an ESB’s notion of loose coupling and platform agnosticism
• Non-standard implementations
– Often an ESB provider will implement a protocol “their way” which can be
problematic for more standard platforms
• Disorganized Dependencies
– With all of the various transports, frameworks, and protocols an ESB
should be capable of delivering, our dependency libraries can get messy
• Deployment Governance
– And with so many developers contributing to an organization’s ESB logic,
controlling all of that deployment creates its own set of challenges
14© 2018 Rogue Wave Software, Inc. All Rights Reserved. 14
But isn’t Camel an ESB?
• No! Camel can form an essential part of an ESB, like it does in the
Apache Servicemix product
• But it is a standalone normalized messaging framework
• Camel is an example of one part of a Message Oriented Middleware
system
• It provides a routing and choreographing framework for moving data
around an enterprise
• Message Oriented Middleware often consists of several different platforms
orchestrating in concert
15© 2018 Rogue Wave Software, Inc. All Rights Reserved. 15
But isn’t Camel an ESB?
• No! Camel can form an essential part of an ESB, like it does in the
Apache Servicemix product
• But it is a standalone normalized messaging framework
• Camel is an example of one part of a Message Oriented Middleware
system
• It provides a routing and choreographing framework for moving data
around an enterprise
• Message Oriented Middleware often consists of several different platforms
orchestrating in concert
16© 2018 Rogue Wave Software, Inc. All Rights Reserved. 16
Message oriented middleware
• Technically, MOM is any platform that sends and receives messages
between distributed applications
• This allows for asynchronous processing, and normalization of data
exchanges
• Clients connect to a messaging provider, and send and receive
messages via that provider
17© 2018 Rogue Wave Software, Inc. All Rights Reserved. 17
What’s it good for?
• Data normalization makes it a lot easier for disparate applications to
trade information
• Just like in web services, heterogeneous systems can agree on a data
“contract” and send and receive data in that format
• All the application needs is a client compatible with the messaging
provider
• And since messages are allowed to queue up on the message provider,
it also makes it very easy to perform asynchronous processing
• Most message providers offer additional benefits, like guaranteed
delivery, options for traffic shaping, high availability, and scaling
18© 2018 Rogue Wave Software, Inc. All Rights Reserved. 18
What is Camel?
19© 2018 Rogue Wave Software, Inc. All Rights Reserved. 19
The repetitive world of integration
• So, data routing and transformation in the Enterprise lends itself to a lot of what
you would call “boilerplate” code
• Boilerplate text, in publishing, is text that can be used and reused in many
places
• Boilerplate code is the same concept
• How many times have you written code to open up a web server, push a file to
an ftp site or drop a message into a message broker?
• Have you ever felt that you’re just writing different versions of the same thing
over and over again?
• You’re not alone
• Enter the concept of an Enterprise Integration Pattern…
20© 2018 Rogue Wave Software, Inc. All Rights Reserved. 20
What’s Camel?
• Camel is an open source MOM language developed by Apache and based
on Enterprise Integration Patterns
• Book by Gregor Hohpe and Bobby Woolf
• Centers around 60+ common patterns found
in Enterprise integration projects
• Defines these common patterns in a vendor
neutral way
• Camel aims to provide a language which
implements these patterns, in a style
modeled after the UNIX pipeline
21© 2018 Rogue Wave Software, Inc. All Rights Reserved. 21
Project notes
• Camel is maintained by the Apache Camel community
• It is a top-level project hosted at http://camel.apache.org
• The project’s chief maintainer is Claus Ibsen, author of Camel in Action
• As of August of 2017, the project has had almost 400 distinct committers,
spanning over 30,000 commits
• It is written primarily in Java, and also contains some Scala code
• The project is licensed under the ALv2 (Apache License v2.0), which is
considered a permissive license
• So, Camel has been folded in to many other projects, including the Mule ESB
and the Switchyard project
• Camel can be run standalone, packaged into a WAR, or deployed as an OSGI
bundle
• A POJO syntax as well as a Spring DSL XML syntax are made available for
developers
22© 2018 Rogue Wave Software, Inc. All Rights Reserved. 22
Integration patterns
• Content Based Router
– Where a message is routed to disparate endpoints based on message criteria
23© 2018 Rogue Wave Software, Inc. All Rights Reserved. 23
Integration patterns
• Content Enricher
– In which a basic message enters the pattern, takes data from another
source, and then adds it to the message
24© 2018 Rogue Wave Software, Inc. All Rights Reserved. 24
Integration patterns
• Recipient List
– A message is broadcast to n channels based on message criteria. When this message
is broadcast to all channels regardless, it becomes a Multicast pattern
25© 2018 Rogue Wave Software, Inc. All Rights Reserved. 25
Integration patterns
• Scatter-Gather
– In which messages are broadcast out to disparate endpoints and results are
aggregated into a single message
26© 2018 Rogue Wave Software, Inc. All Rights Reserved. 26
How does it work?
• Camel uses a repeatable, normalized concatenation of “Processor” and
”Message” objects in a group called an Exchange
• There is an ”In” message, a “Processor”, and an “Out” message
Processor
In Out
27© 2018 Rogue Wave Software, Inc. All Rights Reserved. 27
How does it work?
• And, you can chain these Exchanges together – just like piping commands
through UNIX – and form a Camel Route
• The “Out” message of a previous Exchange becomes the “In” message of a
new Exchange:
P
In Out
P
In Out
P
In Out
28© 2018 Rogue Wave Software, Inc. All Rights Reserved. 28
Camel magic
• Now here’s the magical part – a Processor can be anything you want
• Components in Camel work by creating Processors that perform various
business functions
• The components can be chained together to build Integration Patterns
• For instance, you can have an “FTP” processor that takes the In message
and initiates an FTP session
• Or you can have an “SMTP” processor that takes the In message and
sends an email with it
• This is in addition to Camel’s many built-in patterns, such as LoadBalance,
Multicast, DataSets, etc.
• And there are a lot of components:
http://camel.apache.org/components.html
29© 2018 Rogue Wave Software, Inc. All Rights Reserved. 29
Camel components
Uhm, yeah, the list isn’t gonna fit…
The point is there are a lot!
30© 2018 Rogue Wave Software, Inc. All Rights Reserved. 30
Embedded scripting languages
• Camel also contains a number of embedded script languages that can be
used for various purposes
• Simple: The Simple query language can be used to introspect message
headers, payloads, and properties, and is useful when routing messages
based on their content
• Xpath: The XPath query language will let you traverse XML structures
and query for attribute and entity values, which is great for routing
messages based on their XML content
• JSONPath: Just like XPath, except for JSON-structured messages
• Groovy: The Groovy scripting language can be used for more advanced
data introspection and manipulation
• JavaScript: Yes, you can do entire processors in JavaScript
31© 2018 Rogue Wave Software, Inc. All Rights Reserved. 31
Camel source
• Camel routes can be coded in Java POJO
• Or by using Camel Spring DSL XML files
from("activemq:foo").filter().
xquery("//foo").
to("activemq:bar")
<route xmlns="http://camel.apache.org/schema/spring" id="TimerClient">
<from uri=”activemq:topic:broadcastData"/>
<setBody>
<constant>This is a test JMS message.</constant>
</setBody>
<to uri="activemq:Test_ActiveMQ_Route.inQueue"/>
</route>
32© 2018 Rogue Wave Software, Inc. All Rights Reserved. 32
Camel deployment
• Camel can be deployed in a number of ways:
• It can be deployed as a Java Web App using Spring or POJO
• Standalone Camel routes can also be deployed using Maven and Camel
• Spring Boot can launch Camel routes
• Camel can be embedded within another Java application
• Or within a Java-based container such as Jetty, Tomcat, JBoss/Wildfly, and
others
• ActiveMQ contains the Camel core libraries and can launch and deploy
Camel routes
• And OSGI containers like Karaf or its Servicemix counterpart can launch
Camel routes
• Standalone Camel routes scale very nicely in microservice containers as
well
33© 2018 Rogue Wave Software, Inc. All Rights Reserved. 33
Camel development
• Major IDEs like Eclipse and IntelliJ can ease Camel development by
allowing routes to execute within the IDE
• As of Camel 2.16, comprehensive in-line tools are available which allow
auto-completion and even list every parameter of an available component
34© 2018 Rogue Wave Software, Inc. All Rights Reserved. 34
Camel development
• But HawtIO is my current favorite way to prototype with Camel
• HawtIO allows for visual debugging of routes, tracing of message
lifecycle, diagram driven development, as well as monitoring
35© 2018 Rogue Wave Software, Inc. All Rights Reserved. 35
Camel monitoring
• Camel has a robust set of JMX instrumentation beans which can be
looked at to gain more information on the route
• Any JMX-capable enterprise monitoring solution will be a good fit for
Camel
36© 2018 Rogue Wave Software, Inc. All Rights Reserved. 36
So Camel is pretty awesome…
• Camel provides many benefits for enterprise messaging applications
• It comes with a free library of over a hundred integration components, as well
as a powerful framework for creating your own components
• Camel routes can be visually debugged, similar to jBPM or BPEL
• Camel cuts down on boilerplate code enormously, by providing Spring-based
integration components for popular applications and frameworks
• Camel is FOSS under Apache 2.0 License
• As Camel improves its underlying Spring libraries, you can take advantage of
better functionality with very little if any development effort
• Camel’s syntax is very easy to understand and provides a low learning curve
for developers
37© 2018 Rogue Wave Software, Inc. All Rights Reserved. 37
Demo: Content based router
• In this example, we will be using a very simple content based router
• In fact, we’ll be using the Simple query language to introspect a JMS
header in a message, and routing it to a destination based on the contents
of that header
• We will use Camel deployed directly into ActiveMQ, and we’ll write it from
scratch against a clean ActiveMQ install
38© 2018 Rogue Wave Software, Inc. All Rights Reserved. 38
Demo: File content translator
• Here we will read the contents of new files entering into a file directory, and
convert these files into JMS messages
39© 2018 Rogue Wave Software, Inc. All Rights Reserved. 39
Demo: JMS to JMS Bridge
• We will use Camel to connect two ActiveMQ instances to one another
• Messages will be consumed from a destination on the external instance,
and produced into another destination on the internal instance
40© 2018 Rogue Wave Software, Inc. All Rights Reserved. 40
Claim check pattern
• Here we will implement a basic claim check pattern
• Messages will be stored in a local Postgres database, the payload
contents will be altered in the route, and then the original payload will be
retrieved
41© 2018 Rogue Wave Software, Inc. All Rights Reserved. 41
Questions?
Feel free to reach out after, too!
justin.reock@roguewave.com

More Related Content

PDF
State of integration with Apache Camel (ApacheCon 2019)
PDF
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
PPTX
Serverless integration with Knative and Apache Camel on Kubernetes
PDF
Apache Camel v3, Camel K and Camel Quarkus
PDF
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
PDF
Best Practices for Middleware and Integration Architecture Modernization with...
PPTX
Apache Camel K - Copenhagen v2
PDF
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
State of integration with Apache Camel (ApacheCon 2019)
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Serverless integration with Knative and Apache Camel on Kubernetes
Apache Camel v3, Camel K and Camel Quarkus
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
Best Practices for Middleware and Integration Architecture Modernization with...
Apache Camel K - Copenhagen v2
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...

What's hot (20)

PPTX
Apache Camel K - Copenhagen
PDF
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
PPTX
Camel riders in the cloud
ODP
Sun Web Server Brief
PDF
Integrating systems in the age of Quarkus and Camel
PPTX
Apache Camel K - Fredericia
PDF
Camel Day Italy 2021 - What's new in Camel 3
PDF
What's new with Apache Camel 3? | DevNation Tech Talk
PPTX
Integrating microservices with apache camel on kubernetes
PPTX
Building flexible ETL pipelines with Apache Camel on Quarkus
ODP
Developing Microservices with Apache Camel
PDF
ApacheCon NA - Apache Camel K: a cloud-native integration platform
PPTX
ApacheCon EU 2016 - Apache Camel the integration library
PDF
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
PDF
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
PDF
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
PDF
Enterprise Integration Patterns with Apache Camel
PDF
Event Driven Architecture with Apache Camel
ODP
Using Apache Camel connectors for external connectivity
PDF
Developing Java based microservices ready for the world of containers
Apache Camel K - Copenhagen
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
Camel riders in the cloud
Sun Web Server Brief
Integrating systems in the age of Quarkus and Camel
Apache Camel K - Fredericia
Camel Day Italy 2021 - What's new in Camel 3
What's new with Apache Camel 3? | DevNation Tech Talk
Integrating microservices with apache camel on kubernetes
Building flexible ETL pipelines with Apache Camel on Quarkus
Developing Microservices with Apache Camel
ApacheCon NA - Apache Camel K: a cloud-native integration platform
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Enterprise Integration Patterns with Apache Camel
Event Driven Architecture with Apache Camel
Using Apache Camel connectors for external connectivity
Developing Java based microservices ready for the world of containers
Ad

Similar to The forgotten route: Making Apache Camel work for you (20)

PPTX
Making Apache Camel work for you
PPTX
Integrating Postgres with ActiveMQ and Camel
PPT
Riding with camel
PDF
Solving Enterprise Integration with Apache Camel
PPTX
Enterprise Integration Patterns and Apache Camel
PPT
Simplify your integrations with Apache Camel
ODP
Red Hat Open Day JBoss Fuse
PPT
Succeding with the Apache SOA stack
PDF
Apache Camel Introduction
ODP
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
PPTX
Essential Camel Components
PDF
Make easier Integration of your services with Fuse Solutions - RedHat 2013
PDF
Introduction To Apache Camel
PPTX
ZendCon - Integration and Asynchronous Processing with ActiveMQ and Camel
ODP
01 apache camel-intro
PDF
Simplify integrations-final-pdf
PDF
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
PDF
TS 4839 - Enterprise Integration Patterns in Practice
PDF
Leverage Enterprise Integration Patterns with Apache Camel and Twitter
PPTX
Apache camel overview dec 2011
Making Apache Camel work for you
Integrating Postgres with ActiveMQ and Camel
Riding with camel
Solving Enterprise Integration with Apache Camel
Enterprise Integration Patterns and Apache Camel
Simplify your integrations with Apache Camel
Red Hat Open Day JBoss Fuse
Succeding with the Apache SOA stack
Apache Camel Introduction
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Essential Camel Components
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Introduction To Apache Camel
ZendCon - Integration and Asynchronous Processing with ActiveMQ and Camel
01 apache camel-intro
Simplify integrations-final-pdf
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
TS 4839 - Enterprise Integration Patterns in Practice
Leverage Enterprise Integration Patterns with Apache Camel and Twitter
Apache camel overview dec 2011
Ad

More from Rogue Wave Software (20)

PPTX
The Global Influence of Open Banking, API Security, and an Open Data Perspective
PPTX
No liftoff, touchdown, or heartbeat shall miss because of a software failure
PDF
Disrupt or be disrupted – Using secure APIs to drive digital transformation
PPTX
Leveraging open banking specifications for rigorous API security – What’s in...
PPTX
Adding layers of security to an API in real-time
PPTX
Getting the most from your API management platform: A case study
PPTX
Advanced technologies and techniques for debugging HPC applications
PPTX
Are open source and embedded software development on a collision course?
PDF
Three big mistakes with APIs and microservices
PPTX
5 strategies for enterprise cloud infrastructure success
PPTX
PSD2 & Open Banking: How to go from standards to implementation and compliance
PPTX
Java 10 and beyond: Keeping up with the language and planning for the future
PPTX
How to keep developers happy and lawyers calm (Presented at ESC Boston)
PPTX
Open source applied - Real world use cases (Presented at Open Source 101)
PPTX
How to migrate SourcePro apps from Solaris to Linux
PPTX
Approaches to debugging mixed-language HPC apps
PPTX
Enterprise Linux: Justify your migration from Red Hat to CentOS
PPTX
Walk through an enterprise Linux migration
PPTX
How to keep developers happy and lawyers calm
PPTX
Open source and embedded software development
The Global Influence of Open Banking, API Security, and an Open Data Perspective
No liftoff, touchdown, or heartbeat shall miss because of a software failure
Disrupt or be disrupted – Using secure APIs to drive digital transformation
Leveraging open banking specifications for rigorous API security – What’s in...
Adding layers of security to an API in real-time
Getting the most from your API management platform: A case study
Advanced technologies and techniques for debugging HPC applications
Are open source and embedded software development on a collision course?
Three big mistakes with APIs and microservices
5 strategies for enterprise cloud infrastructure success
PSD2 & Open Banking: How to go from standards to implementation and compliance
Java 10 and beyond: Keeping up with the language and planning for the future
How to keep developers happy and lawyers calm (Presented at ESC Boston)
Open source applied - Real world use cases (Presented at Open Source 101)
How to migrate SourcePro apps from Solaris to Linux
Approaches to debugging mixed-language HPC apps
Enterprise Linux: Justify your migration from Red Hat to CentOS
Walk through an enterprise Linux migration
How to keep developers happy and lawyers calm
Open source and embedded software development

Recently uploaded (20)

PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
"Secure File Sharing Solutions on AWS".pptx
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PDF
Microsoft Office 365 Crack Download Free
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
AI Guide for Business Growth - Arna Softech
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
Time Tracking Features That Teams and Organizations Actually Need
Weekly report ppt - harsh dattuprasad patel.pptx
Salesforce Agentforce AI Implementation.pdf
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
"Secure File Sharing Solutions on AWS".pptx
Cybersecurity: Protecting the Digital World
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Microsoft Office 365 Crack Download Free
Oracle Fusion HCM Cloud Demo for Beginners
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Tech Workshop Escape Room Tech Workshop
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
How to Use SharePoint as an ISO-Compliant Document Management System
AI Guide for Business Growth - Arna Softech
Autodesk AutoCAD Crack Free Download 2025
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Visual explanation of Dijkstra's Algorithm using Python
Topaz Photo AI Crack New Download (Latest 2025)
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Time Tracking Features That Teams and Organizations Actually Need

The forgotten route: Making Apache Camel work for you

  • 1. 1© 2018 Rogue Wave Software, Inc. All Rights Reserved. 1 Making Camel Work for You • Justin Reock • Sr. Director and Lead Architect • Rogue Wave OSS Support
  • 2. 2© 2018 Rogue Wave Software, Inc. All Rights Reserved. 2 Who’s speaking to me?
  • 3. 3© 2018 Rogue Wave Software, Inc. All Rights Reserved. 3 Justin Reock • Sr. Director and Lead Architect of our OSS Support Team • Way too much experience with ActiveMQ and Camel • Developed our formal instructor-led training • Numerous professional services and training engagements • Early adopter of JMS and Camel • Major FL/OSS evangelist!
  • 4. 4© 2018 Rogue Wave Software, Inc. All Rights Reserved. 4 What are we going to solve?
  • 5. 5© 2018 Rogue Wave Software, Inc. All Rights Reserved. 5 Quick exercise… • I’m going to show you three slides • They all have something in common…. • See if you can figure out what it is!
  • 6. 6© 2018 Rogue Wave Software, Inc. All Rights Reserved. 6 The Chupacabra…
  • 7. 7© 2018 Rogue Wave Software, Inc. All Rights Reserved. 7 A magical unicorn…
  • 8. 8© 2018 Rogue Wave Software, Inc. All Rights Reserved. 8 BillingFulfillment CRME-Commerce A homogeneous enterprise landscape…
  • 9. 9© 2018 Rogue Wave Software, Inc. All Rights Reserved. 9 Answer  None of these things exist in real life!
  • 10. 10© 2018 Rogue Wave Software, Inc. All Rights Reserved. 10 A Word on ESBs • An Enterprise Service Bus is an architectural design pattern that focuses on providing federation between systems using a common runtime • Ideally, a Service Bus will provide loosely coupled endpoints to which various, heterogeneous systems can communicate with one another via their native frameworks • So, for instance, a .NET SOAP-driven application should be able to send data along the bus, which could be received by, say, a Java-based JMS destination • The ESB will provide payload and protocol normalization to facilitate that communication • Loose coupling will ensure that services can remain unaware of federated services’ languages and frameworks
  • 11. 11© 2018 Rogue Wave Software, Inc. All Rights Reserved. 11 Examples of ESBs
  • 12. 12© 2018 Rogue Wave Software, Inc. All Rights Reserved. 12 Common Enterprise Architecture Problems • No Universal Rules and Routing – Many application frameworks and protocols exist, but they are fragmented – They may use different protocols, data formats, and remote communication methods • Need for scale – Business tend to grow their infrastructure and federate more systems – As they do, the need for better scalability presents itself • Heterogeneous clients – Server frameworks aside, the application layer also tends to be highly fragmented – You will no doubt have applications in different languages that have a need to communicate with one another
  • 13. 13© 2018 Rogue Wave Software, Inc. All Rights Reserved. 13 Common problems with ESBs • Custom Adapters – When not using something like SOAP, often there is a need to customize an ESB client to fit into a particular framework – This refutes an ESB’s notion of loose coupling and platform agnosticism • Non-standard implementations – Often an ESB provider will implement a protocol “their way” which can be problematic for more standard platforms • Disorganized Dependencies – With all of the various transports, frameworks, and protocols an ESB should be capable of delivering, our dependency libraries can get messy • Deployment Governance – And with so many developers contributing to an organization’s ESB logic, controlling all of that deployment creates its own set of challenges
  • 14. 14© 2018 Rogue Wave Software, Inc. All Rights Reserved. 14 But isn’t Camel an ESB? • No! Camel can form an essential part of an ESB, like it does in the Apache Servicemix product • But it is a standalone normalized messaging framework • Camel is an example of one part of a Message Oriented Middleware system • It provides a routing and choreographing framework for moving data around an enterprise • Message Oriented Middleware often consists of several different platforms orchestrating in concert
  • 15. 15© 2018 Rogue Wave Software, Inc. All Rights Reserved. 15 But isn’t Camel an ESB? • No! Camel can form an essential part of an ESB, like it does in the Apache Servicemix product • But it is a standalone normalized messaging framework • Camel is an example of one part of a Message Oriented Middleware system • It provides a routing and choreographing framework for moving data around an enterprise • Message Oriented Middleware often consists of several different platforms orchestrating in concert
  • 16. 16© 2018 Rogue Wave Software, Inc. All Rights Reserved. 16 Message oriented middleware • Technically, MOM is any platform that sends and receives messages between distributed applications • This allows for asynchronous processing, and normalization of data exchanges • Clients connect to a messaging provider, and send and receive messages via that provider
  • 17. 17© 2018 Rogue Wave Software, Inc. All Rights Reserved. 17 What’s it good for? • Data normalization makes it a lot easier for disparate applications to trade information • Just like in web services, heterogeneous systems can agree on a data “contract” and send and receive data in that format • All the application needs is a client compatible with the messaging provider • And since messages are allowed to queue up on the message provider, it also makes it very easy to perform asynchronous processing • Most message providers offer additional benefits, like guaranteed delivery, options for traffic shaping, high availability, and scaling
  • 18. 18© 2018 Rogue Wave Software, Inc. All Rights Reserved. 18 What is Camel?
  • 19. 19© 2018 Rogue Wave Software, Inc. All Rights Reserved. 19 The repetitive world of integration • So, data routing and transformation in the Enterprise lends itself to a lot of what you would call “boilerplate” code • Boilerplate text, in publishing, is text that can be used and reused in many places • Boilerplate code is the same concept • How many times have you written code to open up a web server, push a file to an ftp site or drop a message into a message broker? • Have you ever felt that you’re just writing different versions of the same thing over and over again? • You’re not alone • Enter the concept of an Enterprise Integration Pattern…
  • 20. 20© 2018 Rogue Wave Software, Inc. All Rights Reserved. 20 What’s Camel? • Camel is an open source MOM language developed by Apache and based on Enterprise Integration Patterns • Book by Gregor Hohpe and Bobby Woolf • Centers around 60+ common patterns found in Enterprise integration projects • Defines these common patterns in a vendor neutral way • Camel aims to provide a language which implements these patterns, in a style modeled after the UNIX pipeline
  • 21. 21© 2018 Rogue Wave Software, Inc. All Rights Reserved. 21 Project notes • Camel is maintained by the Apache Camel community • It is a top-level project hosted at http://camel.apache.org • The project’s chief maintainer is Claus Ibsen, author of Camel in Action • As of August of 2017, the project has had almost 400 distinct committers, spanning over 30,000 commits • It is written primarily in Java, and also contains some Scala code • The project is licensed under the ALv2 (Apache License v2.0), which is considered a permissive license • So, Camel has been folded in to many other projects, including the Mule ESB and the Switchyard project • Camel can be run standalone, packaged into a WAR, or deployed as an OSGI bundle • A POJO syntax as well as a Spring DSL XML syntax are made available for developers
  • 22. 22© 2018 Rogue Wave Software, Inc. All Rights Reserved. 22 Integration patterns • Content Based Router – Where a message is routed to disparate endpoints based on message criteria
  • 23. 23© 2018 Rogue Wave Software, Inc. All Rights Reserved. 23 Integration patterns • Content Enricher – In which a basic message enters the pattern, takes data from another source, and then adds it to the message
  • 24. 24© 2018 Rogue Wave Software, Inc. All Rights Reserved. 24 Integration patterns • Recipient List – A message is broadcast to n channels based on message criteria. When this message is broadcast to all channels regardless, it becomes a Multicast pattern
  • 25. 25© 2018 Rogue Wave Software, Inc. All Rights Reserved. 25 Integration patterns • Scatter-Gather – In which messages are broadcast out to disparate endpoints and results are aggregated into a single message
  • 26. 26© 2018 Rogue Wave Software, Inc. All Rights Reserved. 26 How does it work? • Camel uses a repeatable, normalized concatenation of “Processor” and ”Message” objects in a group called an Exchange • There is an ”In” message, a “Processor”, and an “Out” message Processor In Out
  • 27. 27© 2018 Rogue Wave Software, Inc. All Rights Reserved. 27 How does it work? • And, you can chain these Exchanges together – just like piping commands through UNIX – and form a Camel Route • The “Out” message of a previous Exchange becomes the “In” message of a new Exchange: P In Out P In Out P In Out
  • 28. 28© 2018 Rogue Wave Software, Inc. All Rights Reserved. 28 Camel magic • Now here’s the magical part – a Processor can be anything you want • Components in Camel work by creating Processors that perform various business functions • The components can be chained together to build Integration Patterns • For instance, you can have an “FTP” processor that takes the In message and initiates an FTP session • Or you can have an “SMTP” processor that takes the In message and sends an email with it • This is in addition to Camel’s many built-in patterns, such as LoadBalance, Multicast, DataSets, etc. • And there are a lot of components: http://camel.apache.org/components.html
  • 29. 29© 2018 Rogue Wave Software, Inc. All Rights Reserved. 29 Camel components Uhm, yeah, the list isn’t gonna fit… The point is there are a lot!
  • 30. 30© 2018 Rogue Wave Software, Inc. All Rights Reserved. 30 Embedded scripting languages • Camel also contains a number of embedded script languages that can be used for various purposes • Simple: The Simple query language can be used to introspect message headers, payloads, and properties, and is useful when routing messages based on their content • Xpath: The XPath query language will let you traverse XML structures and query for attribute and entity values, which is great for routing messages based on their XML content • JSONPath: Just like XPath, except for JSON-structured messages • Groovy: The Groovy scripting language can be used for more advanced data introspection and manipulation • JavaScript: Yes, you can do entire processors in JavaScript
  • 31. 31© 2018 Rogue Wave Software, Inc. All Rights Reserved. 31 Camel source • Camel routes can be coded in Java POJO • Or by using Camel Spring DSL XML files from("activemq:foo").filter(). xquery("//foo"). to("activemq:bar") <route xmlns="http://camel.apache.org/schema/spring" id="TimerClient"> <from uri=”activemq:topic:broadcastData"/> <setBody> <constant>This is a test JMS message.</constant> </setBody> <to uri="activemq:Test_ActiveMQ_Route.inQueue"/> </route>
  • 32. 32© 2018 Rogue Wave Software, Inc. All Rights Reserved. 32 Camel deployment • Camel can be deployed in a number of ways: • It can be deployed as a Java Web App using Spring or POJO • Standalone Camel routes can also be deployed using Maven and Camel • Spring Boot can launch Camel routes • Camel can be embedded within another Java application • Or within a Java-based container such as Jetty, Tomcat, JBoss/Wildfly, and others • ActiveMQ contains the Camel core libraries and can launch and deploy Camel routes • And OSGI containers like Karaf or its Servicemix counterpart can launch Camel routes • Standalone Camel routes scale very nicely in microservice containers as well
  • 33. 33© 2018 Rogue Wave Software, Inc. All Rights Reserved. 33 Camel development • Major IDEs like Eclipse and IntelliJ can ease Camel development by allowing routes to execute within the IDE • As of Camel 2.16, comprehensive in-line tools are available which allow auto-completion and even list every parameter of an available component
  • 34. 34© 2018 Rogue Wave Software, Inc. All Rights Reserved. 34 Camel development • But HawtIO is my current favorite way to prototype with Camel • HawtIO allows for visual debugging of routes, tracing of message lifecycle, diagram driven development, as well as monitoring
  • 35. 35© 2018 Rogue Wave Software, Inc. All Rights Reserved. 35 Camel monitoring • Camel has a robust set of JMX instrumentation beans which can be looked at to gain more information on the route • Any JMX-capable enterprise monitoring solution will be a good fit for Camel
  • 36. 36© 2018 Rogue Wave Software, Inc. All Rights Reserved. 36 So Camel is pretty awesome… • Camel provides many benefits for enterprise messaging applications • It comes with a free library of over a hundred integration components, as well as a powerful framework for creating your own components • Camel routes can be visually debugged, similar to jBPM or BPEL • Camel cuts down on boilerplate code enormously, by providing Spring-based integration components for popular applications and frameworks • Camel is FOSS under Apache 2.0 License • As Camel improves its underlying Spring libraries, you can take advantage of better functionality with very little if any development effort • Camel’s syntax is very easy to understand and provides a low learning curve for developers
  • 37. 37© 2018 Rogue Wave Software, Inc. All Rights Reserved. 37 Demo: Content based router • In this example, we will be using a very simple content based router • In fact, we’ll be using the Simple query language to introspect a JMS header in a message, and routing it to a destination based on the contents of that header • We will use Camel deployed directly into ActiveMQ, and we’ll write it from scratch against a clean ActiveMQ install
  • 38. 38© 2018 Rogue Wave Software, Inc. All Rights Reserved. 38 Demo: File content translator • Here we will read the contents of new files entering into a file directory, and convert these files into JMS messages
  • 39. 39© 2018 Rogue Wave Software, Inc. All Rights Reserved. 39 Demo: JMS to JMS Bridge • We will use Camel to connect two ActiveMQ instances to one another • Messages will be consumed from a destination on the external instance, and produced into another destination on the internal instance
  • 40. 40© 2018 Rogue Wave Software, Inc. All Rights Reserved. 40 Claim check pattern • Here we will implement a basic claim check pattern • Messages will be stored in a local Postgres database, the payload contents will be altered in the route, and then the original payload will be retrieved
  • 41. 41© 2018 Rogue Wave Software, Inc. All Rights Reserved. 41 Questions? Feel free to reach out after, too! justin.reock@roguewave.com