SlideShare a Scribd company logo
1 of 43
Download to read offline
Integrating your applications easily
<log id=”ids” message=”rmarting, jromanmartin” />
<log id=”name” message=”Jose Roman Martin Gil” />
<log id=”role” message=”Principal Middleware Architect” />
<log id=”company” message=”Red Hat” />
<log id=”labels” message=”father, husband, friend, runner,
curious, Red Hatter, developer, integrator (in any order)” />
<to uri=”mailto:rmarting@redhat.com” />
<to uri=”GitHub:https://github.com/rmarting” />
<to uri=”Twitter:https://twitter.com/jromanmartin” />
<to uri=”LinkedIn:https://www.linkedin.com/in/jromanmartin/” />
<from uri=”whoami”>
SYSTEM INTEGRATION
System Integration
The process of bringing together the component subsystems into one system
and ensuring that the subsystems function together as a system.
Why Integration?
● Critical for business
● Growth of an enterprise by acquisitions and fusions
● New values are created by combinations of existing products
● Different subsystems use different technologies or languages
● Incremental legacy application replacements
Enterprise Integration Patterns
● Recipes for solving integration problems
● Proven design patterns and recipes for
common integration problems
● Patterns were "Harvested" from a study of
thousands of Integration projects.
● Describes integration problems, solutions and
also provide common vocabulary and diagram
notations
● A book by Gregor Hohpe and Bobby Woolf
○ http:/www.eaipatterns.com
Multiple Integration Styles
TRADITIONAL
INTEGRATION
Pattern-oriented integration
for on-premise and
cloud-based resources.
INTEGRATION
MICROSERVICES
Create and compose
microservices using API and
event-driven interactions.
TRANSITIONAL
INTEGRATION
Blend greenfield and
brownfield to deliver next
generation services.
INTEGRATION FRAMEWORK
Why Integration Framework?
● Don't reinvent the wheel
● It makes your life easier
● As a developer don't have to think about low level code
● Implements common Enterprise Integration Patterns
APACHE CAMEL
What is Apache Camel?
● Versatile Open-Source integration framework based on known Enterprise Integration Patterns
(Apache Camel Web Site)
● Open-Source Java framework that focused on making integration easier and more accessible to
developers. It does this by providing:
○ Concrete implementations of all the widely used EIPS
○ Connectivity to a great variety of transports and APIs,
○ Easy to use Domain Specific Languages (DSLs) to wire EIPs and transports together
Jonathan Anstey (Author Camel in Action)
Apache Camel Provides
200+
COMPONENTS
Batch, messaging,
web services, cloud,
APIs, and more ...
BUILT-IN DATA
TRANSFORMATION
JSON, XML, HL7,
YAML, SOAP, Java,
CSV, Custom
INTUITIVE
FRAMEWORK AND
TOOLING
Build integrations
quickly and easily
without lock-in
ENTERPRISE
INTEGRATION
PATTERNS
Build integrations
using enterprise best
practices.
Create, connect, and
compose APIs with
ease.
NATIVE REST
SUPPORT
APACHE CAMEL ARCHITECTURE
Apache Camel Architecture
Apache Camel Context
● Container of many Camel services, which keeps all the pieces together
Apache Camel Route
● Integration pipeline between an Consumer and Producers
Split
orders
Send
each order
to it’s
process service
Electronics
Others
Customer
Purchase
from("file:work/cbr/input")
.split(xpath("//orders"))
.choice()
.when(xpath("/order:order/order:type = 'E'"))
.to("amqp:queue:electronic/us")
.otherwise()
.recipientList(simple("http4://otherservice"));
Apache Camel Route
Producer
● Produce requests
● End of route
● Dispatching outgoing
requests
Consumer
● Consume requests
● Start of a route
● Dispatching
outgoing replies
Processor
● Intermediate node in
the pipeline
● standard processors
or customized ones
Apache Camel Route - XML vs JavaDSL
<route id="cbr-route">
<from id="_from1" uri="file:work/cbr/input" />
<split id="_split1">
<xpath>//orders</xpath>
<choice id="_choice1">
<when id="_when1">
<xpath>/order:order/order:type=‘E’</xpath>
<to id="_to1" uri="amqp:queue:electronic"/>
<otherwise id="_otherwise1">
<recipientList id="_recipientList1">
<simple>http4://otherservice</simple>
</recipientList>
</choice>
</split>
</route>
from("file:work/cbr/input")
.split(xpath("//orders"))
.choice()
.when(xpath("/order:order/order:type=‘E’"))
.to("amqp:queue:electronic")
.otherwise()
.recipientList(
simple("http4://otherservice"));
Which Camel DSL to Choose and Why?
Apache Camel Endpoint
● Represents endpoint which is capable of sending and receiving (producing
and consuming) messages e.g. FTP server, a Web Service or a JMS broker
● Described by URIs:
○ schema:context/path?options
■ ​schema = identifies component
■ context/path = identifies location of a resource or destination (Configuration)
■ options = setup of properties for component, list of name/value pairs (Parameters)
● Examples:
○ file:inbox/orders?delete=true
○ ftp://john@localhost/ftp?password=nhoj
○ activemq:queue:MyQueue
○ timer://myTimer?period=2000
Apache Camel Endpoint Roles
● Consumer (from)
○ receives messages from an external source and creates a message exchange object,
which the routing rule processes
○ event-driven consumer - waits until message arrives e.g. JMS, HTTP, tcp, udp
○ polling consumer - actively checks for new messages e.g. FTP, file, email
● Producer (to)
○ sends the current message wrapped in the message exchange object to an external
target destination
Apache Camel Message Model
● Message
○ ​basic structure for moving data over a route
○ first created by producer
● Message Exchange - ME
○ ​message container during routing
○ link between producer and consumer
○ Message Exchange Pattern (MEP):
■ InOnly (fire & forget: JMS message)
■ InOut (request-response: HTTP request)
Apache Camel Exchange in Route
PROCESSOR PROCESSOR PROCESSOR
PRODUCER
Exchange
Exchange
In In In
In
Out Out Out
Out
Apache Camel Processor
● Perform actions on the message - modify, use, create, enrich, transform,
validate, intercept, etc.
● Implements the actions of the EIP between the producer/consumer
endpoint
● Processors can be linked in pipeline flow
Apache Camel Component
● Main extension point in Camel
● Contains configurations for Endpoints
● Factory for Endpoint instances
● +200 Endpoint Components
activemq cxf kubernetes jasypt
activemq-journ
al
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
Data Transformation
● ​Data format transformation
○ the data format of message body is transformed from e.g. CSV to formatted
XML
● Data type transformation
○ ​the data type of the message body is transformed
■ java.lang.String -> javax.jms.TextMessage
○ automatic type converter mechanism
● Different Data Formats
○ bindy, csv, json, xml, jaxb, hl7, zip, ...
Converting between Data Format
● Marshal
○ Java Bean → Textual format
● Unmarshal
○ Textual, Binary format → Java Bean
● Dozer
○ Fine-grained integration
○ mapping literal values
○ Use expressions
Sample Data Transformation
Input XML File:
<root>
<child1>text1</child1>
<child2>text2</child2>
</root>
Camel Route:
...
from(“file:///xmlsourcedir”)
.unmarshal().jaxb()
.process(...)
.marshal().json()
.to(“file:///jsondestdir”);
...
Output JSON File:
{"root": {
"child1": "text1",
"child2": "text2"
}
}
Error Handling
● Camel provides Exception Clause to specify error handling per exception type
● Two scopes:
○ global level
○ route specific level
// Generic error handler
errorHandler(deadLetterChannel("errors").maximumRedeliveries(1));
// Special error handling for validation errors
onException(ValidationException.class)
.to("amqp:queue:validation");
from("file:work/cbr/input")
.onException(ShipOrderException.class)
.handled(true)
.bean(ShipService.class, "shipFailed")
.end()
.split(xpath("//orders"))
…;
Security
● Route Security
○ Authentication and Authorization services to proceed on a route or route segment
● Configuration Security
○ Camel allows to crypt/decrypt configuration files containing sensitive information
● Endpoint Security
○ Security offered by components through uri endpointUri associated with the component​
● Payload Security
○ Data Formats that offer encryption/decryption services at the payload level
INTEGRATING APPLICATIONS
API and REST DSL
<camelContext xmlns="http://camel.apache.org/schema/spring">
<rest path="/say">
<get uri="/hello">
<to uri="direct:hello"/>
</get>
<get uri="/bye" consumes="application/json">
<to uri="direct:bye"/>
</get>
<post uri="/bye">
<to uri="mock:update"/>
</post>
</rest>
<route>
<from uri="direct:hello"/> …
</route>
<route>
<from uri="direct:bye"> …
</route>
</camelContext>
Verb
defining
http
method
Basepath
The service
path
Uri template
The service
method and
parameters
Consumes
Accept data format
setting
REST DSL
<restConfiguration bindingMode="auto" component="servlet" port="8080"/>
Message Body Direction Binding Mode Message Body
XML Incoming auto, xml, json_xml POJO
POJO Outgoing auto, xml, json_xml XML
JSON Incoming auto, xml, json_xml POJO
POJO Outgoing auto, xml, json_xml JSON
● camel-netty4-http
● camel-jetty
● camel-servlet
● camel-undertow
Swagger
<restConfiguration apiContextPath="api-docs" bindingMode="json" component="servlet"
contextPath="/demos">
<apiProperty key="cors" value="true"/>
<apiProperty key="api.title" value="API for demo"/>
<apiProperty key="api.version" value="1.0.0"/>
</restConfiguration>
<get uri="/{id}" outType="com.redhat.User">
<description>Find user by id</description>
<param name="id" type="path" description="The id of the user to get" dataType="int"/>
<to uri="bean:userService?method=getUser(${header.id})"/>
</get>
Service Resilience
Apache Camel
microservice
API
Apache Camel
microservice
API
Ruby
microservice
API
.Net
microservice
API
Chain reaction
Spring Boot
microservice
API
SLOW!!
Client
Circuit Breaker
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<hystrix>
<to uri="http://fooservice.com/slow"/>
<onFallback>
<transform>
<constant>Fallback message</constant>
</transform>
</onFallback>
</hystrix>
<to uri="mock:result"/>
</route>
</camelContext>
Apache Camel
microservice
API
API
Service SaaS
Slow! No
response!
Timeout
Fallback
RUNNING APACHE CAMEL
Deploying Apache Camel
● Standalone JAR
● WAR - Servlet Container, e.g. Apache Tomcat, Jetty
● Spring - Spring Boot
● Java EE - e.g. Wildfly, Glassfish, WebLogic, WebSphere
● OSGi Container - e.g. Apache Karaf, ServiceMix
● Cloud - e.g. OpenShift, Kubernetes, Google Compute Engine, Amazon EC2
Spring Boot vs OSGi
Spring Boot OSGi
Spring DSL/Java
Spring Boot Starter module
Fat JARs
Stand-alone App
Embedded dependency
Pre-configured, pre-sugared
Small and lightweight
Blueprint DSL/Java
Blueprint module
Bundles
Modularized
Explicit dependency
Versioned
Hot redeploy
Linux Container
OS
JVM Linux Container
OS
JVM
Spring Boot
OSGi
More Information
● Camel in Action
● Apache Camel Developer’s Cookbook
● Camel Design Patterns
● Community website
○ http://camel.apache.org/
○ https://github.com/apache/camel
● Spring Boot Sample: https://github.com/rmarting/fis-workshop
Questions?
Thank you!

More Related Content

What's hot

Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Mustafa AKIN
 
Follow the (Kafka) Streams
Follow the (Kafka) StreamsFollow the (Kafka) Streams
Follow the (Kafka) Streamsconfluent
 
SFBigAnalytics_20190724: Monitor kafka like a Pro
SFBigAnalytics_20190724: Monitor kafka like a ProSFBigAnalytics_20190724: Monitor kafka like a Pro
SFBigAnalytics_20190724: Monitor kafka like a ProChester Chen
 
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)Netflix: From Zero to Production-Ready in Minutes (QCon 2017)
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)Tim Bozarth
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkRed Hat Developers
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaRichard Gee
 
Devops CI-CD pipeline with Containers
Devops CI-CD pipeline with ContainersDevops CI-CD pipeline with Containers
Devops CI-CD pipeline with ContainersNuSpace
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Westpac Bank Tech Talk 1: Dive into Apache Kafka
Westpac Bank Tech Talk 1: Dive into Apache KafkaWestpac Bank Tech Talk 1: Dive into Apache Kafka
Westpac Bank Tech Talk 1: Dive into Apache Kafkaconfluent
 
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Brent Salisbury
 
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...Red Hat Developers
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
Gatekeeper: API gateway
Gatekeeper: API gatewayGatekeeper: API gateway
Gatekeeper: API gatewayChengHui Weng
 
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&PierreKafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&PierreStreamNative
 
Design and Implementation of Incremental Cooperative Rebalancing
Design and Implementation of Incremental Cooperative RebalancingDesign and Implementation of Incremental Cooperative Rebalancing
Design and Implementation of Incremental Cooperative Rebalancingconfluent
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...confluent
 
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...confluent
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyHostedbyConfluent
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®confluent
 

What's hot (20)

Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
 
Follow the (Kafka) Streams
Follow the (Kafka) StreamsFollow the (Kafka) Streams
Follow the (Kafka) Streams
 
SFBigAnalytics_20190724: Monitor kafka like a Pro
SFBigAnalytics_20190724: Monitor kafka like a ProSFBigAnalytics_20190724: Monitor kafka like a Pro
SFBigAnalytics_20190724: Monitor kafka like a Pro
 
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)Netflix: From Zero to Production-Ready in Minutes (QCon 2017)
Netflix: From Zero to Production-Ready in Minutes (QCon 2017)
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with Kafka
 
Devops CI-CD pipeline with Containers
Devops CI-CD pipeline with ContainersDevops CI-CD pipeline with Containers
Devops CI-CD pipeline with Containers
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Westpac Bank Tech Talk 1: Dive into Apache Kafka
Westpac Bank Tech Talk 1: Dive into Apache KafkaWestpac Bank Tech Talk 1: Dive into Apache Kafka
Westpac Bank Tech Talk 1: Dive into Apache Kafka
 
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
 
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...
Serverless Workflow: New approach to Kubernetes service orchestration | DevNa...
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
Gatekeeper: API gateway
Gatekeeper: API gatewayGatekeeper: API gateway
Gatekeeper: API gateway
 
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&PierreKafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
 
Design and Implementation of Incremental Cooperative Rebalancing
Design and Implementation of Incremental Cooperative RebalancingDesign and Implementation of Incremental Cooperative Rebalancing
Design and Implementation of Incremental Cooperative Rebalancing
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
 
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®
 

Similar to OpenSouthCode 2018 - Integrating your applications easily with Apache Camel

Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Jimmy DeadcOde
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeAman Kohli
 
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax HubImplementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax HubKevin Hakanson
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftChristian Posta
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftChristian Posta
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelIoan Eugen Stan
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageDamien Dallimore
 
JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5Stephan Schmidt
 
Red Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseRed Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseAdrian Gigante
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'EnterprisePyCon Italia
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.Renzo Tomà
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsJudy Breedlove
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8David Chou
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction Miguel Sancho
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajaxSynapseindiappsdevelopment
 

Similar to OpenSouthCode 2018 - Integrating your applications easily with Apache Camel (20)

Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
 
EIP In Practice
EIP In PracticeEIP In Practice
EIP In Practice
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on Purpose
 
Linked Process
Linked ProcessLinked Process
Linked Process
 
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax HubImplementing Messaging Patterns in JavaScript using the OpenAjax Hub
Implementing Messaging Patterns in JavaScript using the OpenAjax Hub
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the message
 
JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5
 
Red Hat Open Day JBoss Fuse
Red Hat Open Day JBoss FuseRed Hat Open Day JBoss Fuse
Red Hat Open Day JBoss Fuse
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'Enterprise
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
CenitHub: Introduction
CenitHub: Introduction CenitHub: Introduction
CenitHub: Introduction
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajax
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

OpenSouthCode 2018 - Integrating your applications easily with Apache Camel

  • 2. <log id=”ids” message=”rmarting, jromanmartin” /> <log id=”name” message=”Jose Roman Martin Gil” /> <log id=”role” message=”Principal Middleware Architect” /> <log id=”company” message=”Red Hat” /> <log id=”labels” message=”father, husband, friend, runner, curious, Red Hatter, developer, integrator (in any order)” /> <to uri=”mailto:rmarting@redhat.com” /> <to uri=”GitHub:https://github.com/rmarting” /> <to uri=”Twitter:https://twitter.com/jromanmartin” /> <to uri=”LinkedIn:https://www.linkedin.com/in/jromanmartin/” /> <from uri=”whoami”>
  • 4. System Integration The process of bringing together the component subsystems into one system and ensuring that the subsystems function together as a system.
  • 5. Why Integration? ● Critical for business ● Growth of an enterprise by acquisitions and fusions ● New values are created by combinations of existing products ● Different subsystems use different technologies or languages ● Incremental legacy application replacements
  • 6. Enterprise Integration Patterns ● Recipes for solving integration problems ● Proven design patterns and recipes for common integration problems ● Patterns were "Harvested" from a study of thousands of Integration projects. ● Describes integration problems, solutions and also provide common vocabulary and diagram notations ● A book by Gregor Hohpe and Bobby Woolf ○ http:/www.eaipatterns.com
  • 7. Multiple Integration Styles TRADITIONAL INTEGRATION Pattern-oriented integration for on-premise and cloud-based resources. INTEGRATION MICROSERVICES Create and compose microservices using API and event-driven interactions. TRANSITIONAL INTEGRATION Blend greenfield and brownfield to deliver next generation services.
  • 9. Why Integration Framework? ● Don't reinvent the wheel ● It makes your life easier ● As a developer don't have to think about low level code ● Implements common Enterprise Integration Patterns
  • 11. What is Apache Camel? ● Versatile Open-Source integration framework based on known Enterprise Integration Patterns (Apache Camel Web Site) ● Open-Source Java framework that focused on making integration easier and more accessible to developers. It does this by providing: ○ Concrete implementations of all the widely used EIPS ○ Connectivity to a great variety of transports and APIs, ○ Easy to use Domain Specific Languages (DSLs) to wire EIPs and transports together Jonathan Anstey (Author Camel in Action)
  • 12. Apache Camel Provides 200+ COMPONENTS Batch, messaging, web services, cloud, APIs, and more ... BUILT-IN DATA TRANSFORMATION JSON, XML, HL7, YAML, SOAP, Java, CSV, Custom INTUITIVE FRAMEWORK AND TOOLING Build integrations quickly and easily without lock-in ENTERPRISE INTEGRATION PATTERNS Build integrations using enterprise best practices. Create, connect, and compose APIs with ease. NATIVE REST SUPPORT
  • 15. Apache Camel Context ● Container of many Camel services, which keeps all the pieces together
  • 16. Apache Camel Route ● Integration pipeline between an Consumer and Producers Split orders Send each order to it’s process service Electronics Others Customer Purchase from("file:work/cbr/input") .split(xpath("//orders")) .choice() .when(xpath("/order:order/order:type = 'E'")) .to("amqp:queue:electronic/us") .otherwise() .recipientList(simple("http4://otherservice"));
  • 17. Apache Camel Route Producer ● Produce requests ● End of route ● Dispatching outgoing requests Consumer ● Consume requests ● Start of a route ● Dispatching outgoing replies Processor ● Intermediate node in the pipeline ● standard processors or customized ones
  • 18. Apache Camel Route - XML vs JavaDSL <route id="cbr-route"> <from id="_from1" uri="file:work/cbr/input" /> <split id="_split1"> <xpath>//orders</xpath> <choice id="_choice1"> <when id="_when1"> <xpath>/order:order/order:type=‘E’</xpath> <to id="_to1" uri="amqp:queue:electronic"/> <otherwise id="_otherwise1"> <recipientList id="_recipientList1"> <simple>http4://otherservice</simple> </recipientList> </choice> </split> </route> from("file:work/cbr/input") .split(xpath("//orders")) .choice() .when(xpath("/order:order/order:type=‘E’")) .to("amqp:queue:electronic") .otherwise() .recipientList( simple("http4://otherservice")); Which Camel DSL to Choose and Why?
  • 19. Apache Camel Endpoint ● Represents endpoint which is capable of sending and receiving (producing and consuming) messages e.g. FTP server, a Web Service or a JMS broker ● Described by URIs: ○ schema:context/path?options ■ ​schema = identifies component ■ context/path = identifies location of a resource or destination (Configuration) ■ options = setup of properties for component, list of name/value pairs (Parameters) ● Examples: ○ file:inbox/orders?delete=true ○ ftp://john@localhost/ftp?password=nhoj ○ activemq:queue:MyQueue ○ timer://myTimer?period=2000
  • 20. Apache Camel Endpoint Roles ● Consumer (from) ○ receives messages from an external source and creates a message exchange object, which the routing rule processes ○ event-driven consumer - waits until message arrives e.g. JMS, HTTP, tcp, udp ○ polling consumer - actively checks for new messages e.g. FTP, file, email ● Producer (to) ○ sends the current message wrapped in the message exchange object to an external target destination
  • 21. Apache Camel Message Model ● Message ○ ​basic structure for moving data over a route ○ first created by producer ● Message Exchange - ME ○ ​message container during routing ○ link between producer and consumer ○ Message Exchange Pattern (MEP): ■ InOnly (fire & forget: JMS message) ■ InOut (request-response: HTTP request)
  • 22. Apache Camel Exchange in Route PROCESSOR PROCESSOR PROCESSOR PRODUCER Exchange Exchange In In In In Out Out Out Out
  • 23. Apache Camel Processor ● Perform actions on the message - modify, use, create, enrich, transform, validate, intercept, etc. ● Implements the actions of the EIP between the producer/consumer endpoint ● Processors can be linked in pipeline flow
  • 24. Apache Camel Component ● Main extension point in Camel ● Contains configurations for Endpoints ● Factory for Endpoint instances ● +200 Endpoint Components activemq cxf kubernetes jasypt activemq-journ al 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
  • 25. Data Transformation ● ​Data format transformation ○ the data format of message body is transformed from e.g. CSV to formatted XML ● Data type transformation ○ ​the data type of the message body is transformed ■ java.lang.String -> javax.jms.TextMessage ○ automatic type converter mechanism ● Different Data Formats ○ bindy, csv, json, xml, jaxb, hl7, zip, ...
  • 26. Converting between Data Format ● Marshal ○ Java Bean → Textual format ● Unmarshal ○ Textual, Binary format → Java Bean ● Dozer ○ Fine-grained integration ○ mapping literal values ○ Use expressions
  • 27. Sample Data Transformation Input XML File: <root> <child1>text1</child1> <child2>text2</child2> </root> Camel Route: ... from(“file:///xmlsourcedir”) .unmarshal().jaxb() .process(...) .marshal().json() .to(“file:///jsondestdir”); ... Output JSON File: {"root": { "child1": "text1", "child2": "text2" } }
  • 28. Error Handling ● Camel provides Exception Clause to specify error handling per exception type ● Two scopes: ○ global level ○ route specific level // Generic error handler errorHandler(deadLetterChannel("errors").maximumRedeliveries(1)); // Special error handling for validation errors onException(ValidationException.class) .to("amqp:queue:validation"); from("file:work/cbr/input") .onException(ShipOrderException.class) .handled(true) .bean(ShipService.class, "shipFailed") .end() .split(xpath("//orders")) …;
  • 29. Security ● Route Security ○ Authentication and Authorization services to proceed on a route or route segment ● Configuration Security ○ Camel allows to crypt/decrypt configuration files containing sensitive information ● Endpoint Security ○ Security offered by components through uri endpointUri associated with the component​ ● Payload Security ○ Data Formats that offer encryption/decryption services at the payload level
  • 31. API and REST DSL <camelContext xmlns="http://camel.apache.org/schema/spring"> <rest path="/say"> <get uri="/hello"> <to uri="direct:hello"/> </get> <get uri="/bye" consumes="application/json"> <to uri="direct:bye"/> </get> <post uri="/bye"> <to uri="mock:update"/> </post> </rest> <route> <from uri="direct:hello"/> … </route> <route> <from uri="direct:bye"> … </route> </camelContext> Verb defining http method Basepath The service path Uri template The service method and parameters Consumes Accept data format setting
  • 32. REST DSL <restConfiguration bindingMode="auto" component="servlet" port="8080"/> Message Body Direction Binding Mode Message Body XML Incoming auto, xml, json_xml POJO POJO Outgoing auto, xml, json_xml XML JSON Incoming auto, xml, json_xml POJO POJO Outgoing auto, xml, json_xml JSON ● camel-netty4-http ● camel-jetty ● camel-servlet ● camel-undertow
  • 33. Swagger <restConfiguration apiContextPath="api-docs" bindingMode="json" component="servlet" contextPath="/demos"> <apiProperty key="cors" value="true"/> <apiProperty key="api.title" value="API for demo"/> <apiProperty key="api.version" value="1.0.0"/> </restConfiguration> <get uri="/{id}" outType="com.redhat.User"> <description>Find user by id</description> <param name="id" type="path" description="The id of the user to get" dataType="int"/> <to uri="bean:userService?method=getUser(${header.id})"/> </get>
  • 34. Service Resilience Apache Camel microservice API Apache Camel microservice API Ruby microservice API .Net microservice API Chain reaction Spring Boot microservice API SLOW!! Client
  • 35. Circuit Breaker <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:start"/> <hystrix> <to uri="http://fooservice.com/slow"/> <onFallback> <transform> <constant>Fallback message</constant> </transform> </onFallback> </hystrix> <to uri="mock:result"/> </route> </camelContext> Apache Camel microservice API API Service SaaS Slow! No response! Timeout Fallback
  • 37. Deploying Apache Camel ● Standalone JAR ● WAR - Servlet Container, e.g. Apache Tomcat, Jetty ● Spring - Spring Boot ● Java EE - e.g. Wildfly, Glassfish, WebLogic, WebSphere ● OSGi Container - e.g. Apache Karaf, ServiceMix ● Cloud - e.g. OpenShift, Kubernetes, Google Compute Engine, Amazon EC2
  • 38. Spring Boot vs OSGi Spring Boot OSGi Spring DSL/Java Spring Boot Starter module Fat JARs Stand-alone App Embedded dependency Pre-configured, pre-sugared Small and lightweight Blueprint DSL/Java Blueprint module Bundles Modularized Explicit dependency Versioned Hot redeploy Linux Container OS JVM Linux Container OS JVM
  • 40. OSGi
  • 41. More Information ● Camel in Action ● Apache Camel Developer’s Cookbook ● Camel Design Patterns ● Community website ○ http://camel.apache.org/ ○ https://github.com/apache/camel ● Spring Boot Sample: https://github.com/rmarting/fis-workshop