SlideShare a Scribd company logo
 
Design a REST Microservice
using Apache Camel
technology
Charles Moulliard (@cmoulliard)
22 Jan 2016
Who
Committer, Coder, Architect
Work on Apache Camel, Karaf, Fabric8, Hawtio, Apiman, DeltaSpike
Mountain Biker, Belgian Beer Fan
Blog:
Twitter:
Email:
http://cmoulliard.github.io
@cmoulliard
cmoulliard@redhat.com
Agenda
Integration …
Apache Camel
Micro Container
Kubernetes Service
 
Integration
Point to Point vision
Integrate many systems. Play with formats & protocols
Hub Approach
In 2003, it was reported that 70% of all EAI projects fail !
Bus
Communication done through a Bus with Normalized messages
MicroService
It is an architectural style where
an application
composed of individual
standalone services
communicating using
lightweight protocols
in event based manner



 
Apache Camel
Apache Camel
Java Integration Framework
Implements Domain Specific Language
Supports Enterprise Integration Patterns

Enterprise Patterns
implemented
and more : Loadbalancer, Throttler, Delayer, …
> 50 patterns
Route, processor
Camel project Collection of routes
Route = Processor(s) + Interceptor(s)
Producing or consuming Message

Java DSL
Fluent API, extend RouteBuilder class
importorg.apache.camel.builder.RouterBuilder;
publicclassFilterRouteextendsRouteBuilder{
publicvoidconfigure()throwsException{
from("activemq:queue:all")
.filter(xpath("/quote/product='widget'"))
.to("activemq:widget");
}
}
XML DSL
Spring, Blueprint
<?xmlversion="1.0"encoding="UTF-8"?>
<beansxmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-
http://camel.apache.org/schema/springhttp://camel.apache.org/schema/spring/camel-spring.xsd
">
<beanid="quotesService"class="my.cool.demo.camel.QuotesService"/>"
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<fromuri="activemq:queue:all"/>
<filter>
<xpath>"/quote/product/='widget"</xpath>
<beanid="quotesService"method="widget"/>
</filter>
</route>
</camelContext>
REST DSL
One of the components available : servlet, jetty, netty, spark, restlet,
undertow
Hostname
Port
Root of the REST Application endpoint
@Overridepublicvoidconfigure()throwsException{
restConfiguration()
.component("servlet")
.host(HOST)
.setPort(PORT);
//usetherestDSLtodefinetherestservices
rest("/users/")
.get("{id}/hello")
.route()
.process(newProcessor(){
publicvoidprocess(Exchangeexchange)throwsException{
Stringid=exchange.getIn().getHeader("id",String.class);
exchange.getOut().setBody("Hello"+id+"!Welcomefrompod:"
}
});
1
2
3
4
5
1
2
3
4
Container agnostic
Endpoints registered
CamelContext
Policy
Security
Lifecycle
Tracing
JMX
Threads can be configured

 
Demo
 
Docker Container
Process
Docker
Union FS mounted with immutable images
Benefits: portability, reusability, versioning, application-centric
Docker config
Docker
Container runtime, Process launcher
Maven Docker Plugin
docker:build Build image of app
docker:push Push image


<docker.from>fabric8/s2i-java:1.2</docker.from>
<docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}
<docker.port.container.jolokia>8778</docker.port.container.jolokia>
<docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<images>
<image>
<name>${docker.image}</name>
<build>
<from>${docker.from}</from>
<assembly>
<basedir>/deployments</basedir>
<descriptorRef>hawt-app</descriptorRef>
</assembly>
<env>
<JAVA_LIB_DIR>/deployments/lib</JAVA_LIB_DIR>
<JAVA_MAIN_CLASS>org.apache.camel.cdi.Main</JAVA_MAIN_CLASS>
</env>
 
With Docker
 
 
Kubernetes & Openshift
Kubernetes
Runtime & Operational management of containers
ApiServer (event, status)
Scheduler, Controller & State Storage
Agent - Kubelet - manage containers on host
Containers pods (= shared docker containers)
Kubernetes
Pod & docker
Communicate to each other using skyDNS to resolve hostname
Pod & port
Ports can be exposed
Pod & volume
Share data using mounted volume between host & container
Kubernetes Service
Kube Service loadbalanced through the pods using HA-Proxy Routes map
private with public IP address
Kube Application JSon
 
Fabric8
Fabric8 Maven Plugin
fabric8:json generates Kube MetaData
fabric8:apply deploy on Openshift


<fabric8.service.name>hellorest</fabric8.service.name>
<fabric8.service.port>9090</fabric8.service.port>
<fabric8.service.containerPort>8080</fabric8.service.containerPort>
<fabric8.label.component>${project.artifactId}</fabric8.label.component>
<fabric8.label.container>tomcat</fabric8.label.container>
<fabric8.label.group>demo</fabric8.label.group>
<fabric8.service.type>LoadBalancer</fabric8.service.type>
<fabric8.iconRef>camel</fabric8.iconRef>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric8.version}</version>
<executions>
<execution>
<id>json</id>
<goals>
<goal>json</goal>
</goals>
 
With OpenShift & Kubernetes
 
Questions
Twitter :
Camel Rest MicroService in Action
@cmoulliard

https://github.com/FuseByExample/microservice-camel-in-action
http://fabric8.io/

More Related Content

What's hot (20)

PPTX
OpenSource Node.js API Framework and Server for Enterprise
Shubhra Kar
 
PDF
Loopback presentation by tineco
Stéphane Guilly
 
PDF
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero
 
PPTX
StrongLoop Overview
Shubhra Kar
 
PDF
Design patterns talk_node_summit
Shubhra Kar
 
PPTX
Triangle Node.js DevOps
Shubhra Kar
 
PDF
Node.js Frameworks & Design Patterns Webinar
Shubhra Kar
 
PDF
Building Mobile Apps With Ionic & Loopback
Chibuzor Obiora
 
PPTX
Connect js nodejs_api_shubhra
Shubhra Kar
 
PDF
Toronto node js_meetup
Shubhra Kar
 
PPTX
Working with LoopBack Models
Raymond Feng
 
PDF
Application Server-less Web Applications - Serverless Toronto Meetup
Daniel Zivkovic
 
PPT
Introduction To Adobe Flex And Semantic Resources
keith_sutton100
 
PDF
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
apidays
 
PPTX
Clean up this mess - API Gateway & Service Discovery in .NET
Marcin Tyborowski
 
PPTX
API Design- Best Practices
Prakash Bhandari
 
PPTX
Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...
Tom Kerkhove
 
PPTX
02 api gateway
Janani Velmurugan
 
PDF
Amazon API Gateway
Mark Bate
 
PPTX
Chatbots with Serverless
Srushith Repakula
 
OpenSource Node.js API Framework and Server for Enterprise
Shubhra Kar
 
Loopback presentation by tineco
Stéphane Guilly
 
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero
 
StrongLoop Overview
Shubhra Kar
 
Design patterns talk_node_summit
Shubhra Kar
 
Triangle Node.js DevOps
Shubhra Kar
 
Node.js Frameworks & Design Patterns Webinar
Shubhra Kar
 
Building Mobile Apps With Ionic & Loopback
Chibuzor Obiora
 
Connect js nodejs_api_shubhra
Shubhra Kar
 
Toronto node js_meetup
Shubhra Kar
 
Working with LoopBack Models
Raymond Feng
 
Application Server-less Web Applications - Serverless Toronto Meetup
Daniel Zivkovic
 
Introduction To Adobe Flex And Semantic Resources
keith_sutton100
 
APIdays Singapore 2019 - API Gateway in a Nutshell, Allan Chua, Solution and ...
apidays
 
Clean up this mess - API Gateway & Service Discovery in .NET
Marcin Tyborowski
 
API Design- Best Practices
Prakash Bhandari
 
Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...
Tom Kerkhove
 
02 api gateway
Janani Velmurugan
 
Amazon API Gateway
Mark Bate
 
Chatbots with Serverless
Srushith Repakula
 

Similar to MicroService and MicroContainer with Apache Camel (20)

PPTX
Microservices with Apache Camel, Docker and Fabric8 v2
Christian Posta
 
PDF
Managing your camels in the cloud with CI/CD
Christian Posta
 
PPTX
Camel riders in the cloud
Claus Ibsen
 
PPTX
Integrating microservices with apache camel on kubernetes
Claus Ibsen
 
PPTX
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
PPTX
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
PDF
EIP In Practice
Bruce Snyder
 
PPTX
Integrating Microservices with Apache Camel
Christian Posta
 
ODP
Developing Microservices with Apache Camel
Claus Ibsen
 
PDF
Microservices with Apache Camel, DDD, and Kubernetes
Christian Posta
 
PDF
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
Claus Ibsen
 
PPTX
Camel as a_glue
Andriy Andrunevchyn
 
PDF
Camel Riders in the Cloud
Red Hat Developers
 
PDF
Using Enterprise Integration Patterns as Your Camel Jockey
Bruce Snyder
 
PDF
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
José Román Martín Gil
 
PPTX
Apache Camel framework Presentation and selection of apache camel for various...
chetansharma041
 
PDF
Red Hat Agile integration Workshop Labs
Judy Breedlove
 
PDF
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Matt Raible
 
PDF
Enterprise Integration Patterns with Apache Camel
Ioan Eugen Stan
 
PPT
Xke - Introduction to Apache Camel
Alexis Kinsella
 
Microservices with Apache Camel, Docker and Fabric8 v2
Christian Posta
 
Managing your camels in the cloud with CI/CD
Christian Posta
 
Camel riders in the cloud
Claus Ibsen
 
Integrating microservices with apache camel on kubernetes
Claus Ibsen
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
EIP In Practice
Bruce Snyder
 
Integrating Microservices with Apache Camel
Christian Posta
 
Developing Microservices with Apache Camel
Claus Ibsen
 
Microservices with Apache Camel, DDD, and Kubernetes
Christian Posta
 
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
Claus Ibsen
 
Camel as a_glue
Andriy Andrunevchyn
 
Camel Riders in the Cloud
Red Hat Developers
 
Using Enterprise Integration Patterns as Your Camel Jockey
Bruce Snyder
 
OpenSouthCode 2018 - Integrating your applications easily with Apache Camel
José Román Martín Gil
 
Apache Camel framework Presentation and selection of apache camel for various...
chetansharma041
 
Red Hat Agile integration Workshop Labs
Judy Breedlove
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Matt Raible
 
Enterprise Integration Patterns with Apache Camel
Ioan Eugen Stan
 
Xke - Introduction to Apache Camel
Alexis Kinsella
 
Ad

More from Charles Moulliard (16)

PDF
Security enforcement of Java Microservices with Apiman & Keycloak
Charles Moulliard
 
PDF
Microservices with WildFly Swarm - JavaSI 2016
Charles Moulliard
 
PDF
Fuse technology-2015
Charles Moulliard
 
PDF
Continuous Delivery & Integration with JBoss Fuse on Openshift
Charles Moulliard
 
PDF
Development of social media projects with Apache Camel, Fabric8 & Hawtio
Charles Moulliard
 
PDF
iPaas with Fuse Fabric Technology
Charles Moulliard
 
PDF
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Charles Moulliard
 
PDF
Karaf ee-apachecon eu-2012
Charles Moulliard
 
PDF
Cloud fuse-apachecon eu-2012
Charles Moulliard
 
PPT
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
PDF
Fusesource camel-persistence-part2-webinar-charles-moulliard
Charles Moulliard
 
PDF
Fusesource camel-persistence-part1-webinar-charles-moulliard
Charles Moulliard
 
PDF
Devoxx 2011 integration-camel-cxf-servicemix-activemq
Charles Moulliard
 
PDF
Be jug 090611_apacheservicemix
Charles Moulliard
 
PDF
Fuse source parisjug-10052011
Charles Moulliard
 
PPT
Apache ServiceMix4 : Dream platform for Java Integration
Charles Moulliard
 
Security enforcement of Java Microservices with Apiman & Keycloak
Charles Moulliard
 
Microservices with WildFly Swarm - JavaSI 2016
Charles Moulliard
 
Fuse technology-2015
Charles Moulliard
 
Continuous Delivery & Integration with JBoss Fuse on Openshift
Charles Moulliard
 
Development of social media projects with Apache Camel, Fabric8 & Hawtio
Charles Moulliard
 
iPaas with Fuse Fabric Technology
Charles Moulliard
 
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Charles Moulliard
 
Karaf ee-apachecon eu-2012
Charles Moulliard
 
Cloud fuse-apachecon eu-2012
Charles Moulliard
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
Fusesource camel-persistence-part2-webinar-charles-moulliard
Charles Moulliard
 
Fusesource camel-persistence-part1-webinar-charles-moulliard
Charles Moulliard
 
Devoxx 2011 integration-camel-cxf-servicemix-activemq
Charles Moulliard
 
Be jug 090611_apacheservicemix
Charles Moulliard
 
Fuse source parisjug-10052011
Charles Moulliard
 
Apache ServiceMix4 : Dream platform for Java Integration
Charles Moulliard
 
Ad

Recently uploaded (20)

PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Digital Circuits, important subject in CS
contactparinay1
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 

MicroService and MicroContainer with Apache Camel