SlideShare ist ein Scribd-Unternehmen logo
1 von 101
Microservices with Apache Camel
Claus Ibsen (@davsclaus)
Principal Software Engineer, Red Hat
Your Speaker
Your Speaker
● Principal Software Engineer at Red Hat
● Apache Camel
● 7 years working with Camel
● Author of Camel in Action books
● Contact
● E-mail: cibsen@redhat.com
● Twitter: @davsclaus
● Blog: http://davsclaus.com
Shameful Advertisement
http://manning.com/ibsen2
Coupon Code
(39% discount)
camel39
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Standalone
● with Docker
● with OpenShift 3 / Kubernetes
● More Information
What is Apache Camel?
● Quote from the website
What is Apache Camel?
● Integration Framework
What is Apache Camel?
● What is Enterprise Integration Patterns?
It's a book
What is Apache Camel?
● Enterprise Integration Patterns
http://camel.apache.org/eip
What is Apache Camel?
● EIP - Content Based Router
What is Apache Camel?
from newOrder
What is Apache Camel?
from newOrder
choice
What is Apache Camel?
from newOrder
choice
when isWidget to widget
What is Apache Camel?
from newOrder
choice
when isWidget to widget
otherwise to gadget
What is Apache Camel?
from(newOrder)
choice
when(isWidget) to(widget)
otherwise to(gadget)
What is Apache Camel?
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
What is Apache Camel?
Endpoint newOrder = endpoint("activemq:queue:newOrder");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
What is Apache Camel?
Endpoint newOrder = endpoint("activemq:queue:newOrder");
Predicate isWidget = xpath("/order/product = 'widget'");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
What is Apache Camel?
Endpoint newOrder = endpoint("activemq:queue:newOrder");
Predicate isWidget = xpath("/order/product = 'widget'");
Endpoint widget = endpoint("activemq:queue:widget");
Endpoint gadget = endpoint("activemq:queue:gadget");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget);
What is Apache Camel?
● Java Code
public void configure() throws Exception {
Endpoint newOrder = endpoint("activemq:queue:newOrder");
Predicate isWidget = xpath("/order/product = 'widget'");
Endpoint widget = endpoint("activemq:queue:widget");
Endpoint gadget = endpoint("activemq:queue:gadget");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget)
.end();
}
What is Apache Camel?
● Java Code
import org.apache.camel.Endpoint;
import org.apache.camel.Predicate;
import org.apache.camel.builder.RouteBuilder;
public class MyRoute extends RouteBuilder {
public void configure() throws Exception {
Endpoint newOrder = endpoint("activemq:queue:newOrder");
Predicate isWidget = xpath("/order/product = 'widget'");
Endpoint widget = endpoint("activemq:queue:widget");
Endpoint gadget = endpoint("activemq:queue:gadget");
from(newOrder)
.choice()
.when(isWidget).to(widget)
.otherwise().to(gadget)
.end();
}
}
What is Apache Camel?
● Camel Java DSL
import org.apache.camel.builder.RouteBuilder;
public class MyRoute extends RouteBuilder {
public void configure() throws Exception {
from("activemq:queue:newOrder")
.choice()
.when(xpath("/order/product = 'widget'"))
.to("activemq:queue:widget")
.otherwise()
.to("activemq:queue:gadget")
.end();
}
}
What is Apache Camel?
● Camel XML DSL
<route>
<from uri="activemq:queue:newOrder"/>
<choice>
<when>
<xpath>/order/product = 'widget'</xpath>
<to uri="activemq:queue:widget"/>
</when>
<otherwise>
<to uri="activemq:queue:gadget"/>
</otherwise>
</choice>
</route>
What is Apache Camel?
● Endpoint as URIs
<route>
<from uri="file:inbox/orders"/>
<choice>
<when>
<xpath>/order/product = 'widget'</xpath>
<to uri="activemq:queue:widget"/>
</when>
<otherwise>
<to uri="activemq:queue:gadget"/>
</otherwise>
</choice>
</route>
use file instead
What is Apache Camel?
● Endpoint as URIs
<route>
<from uri="file:inbox/orders?delete=true"/>
<choice>
<when>
<xpath>/order/product = 'widget'</xpath>
<to uri="activemq:queue:widget"/>
</when>
<otherwise>
<to uri="activemq:queue:gadget"/>
</otherwise>
</choice>
</route>
parameters
What is Apache Camel?
● Java DSL is just Java
What is Apache Camel?
● XML DSL is just XML
● … with XSD schema for validation/tooling
What is Apache Camel?
● Camel's Architecture
What is Apache Camel?
150+ Components
What is Apache Camel?
150+ Components
+
+
+
+
+
+
=
+
+
+
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Standalone
● with Docker
● with OpenShift 3 / Kubernetes
● More Information
Running Camel as Microservices
Standalone Web Application
Camel Spring XML Apache Karaf
Camel Spring Boot Wildfly (wildfly-camel)
Camel CDI vert.x (vertx-camel)
Camel Guice Rest DSL
Camel Microservices
● Apache Karaf
Camel Microservices
● Apache Karaf
Apache Karaf
(boot)
Camel Microservices
● Apache Karaf
Karaf Features
OSGi Bundles
Apache Karaf
(boot)
Camel Microservices
● Apache Karaf
Karaf Features
OSGi Bundles
Apache Karaf
(boot)
Karaf Maven
Plugin
Camel Microservices
● Apache Karaf
Karaf Features
OSGi Bundles
Apache Karaf
(boot)
Karaf Maven
Plugin
Custom Karaf
(with your app)
tar / zip file
Camel Microservices
● Rest DSL
● Use Rest verbs
GET
POST
PUT
...
● Swagger API
● Pluggable Transport
Rest DSL example
Rest DSL example
Rest DSL example
Rest DSL example - add Swagger API
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Hello Service
● Create the Camel projects
● Docker
● OpenShift v3
● More Information
Demo - Hello Service
Hello Service
Demo - Hello Service
Hello Service
Hi I am New York. Hello Claus how are you today?
name=Claus
Demo - Hello Service
Java Standalone Apache Tomcat
HTTP
Hello Service
Demo - Hello Service
Java Standalone Apache Tomcat
HTTP
from timer
to http
to log
from servlet
transform
Hello Service
Demo - Create the Camel Projects
Java Standalone Apache Tomcat
HTTP
from timer
to http
to log
from servlet
transform
Hello Service
camel-archetype-cdi camel-archetype-web
Demo - Create the Camel Projects
● Using Command Shell
● From Eclipse
Demo - Create the Camel Projects
● camel-archetype-web
Ready to use
out of the box
Demo - Create the Camel Projects
● camel-archetype-cdi
Not ready
We need to change
he code
Demo - Create the Camel Projects
● add netty4-http endpoint
CMD + ALT
4
Demo - Create the Camel Projects
● configure netty4-http endpoint
Demo - Create the Camel Projects
● change route to call netty
Demo - Create the Camel Projects
● change bean to return a name
Demo - Overview
● camel-archetype-cdi camel-archetype-web
Java Standalone Apache Tomcat
HTTP 8080
from timer
to http
to log
from http
transform
We are ready to run standalone
Demo - Running Standalone
mvn camel:run
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Hello Service
● Create the Camel projects
● Docker
● OpenShift v3
● More Information
Camel and Docker
Maven Project
Docker Maven
Plugin
Docker Image
build
Add Docker from Command Line
Add Docker from Eclipse / IDEA CMD + ALT
4
Docker Maven Plugin in pom.xml
Build Docker Containers
● mvn clean install docker:build
Build Docker Containers
● After build images in local Docker repository
camel-archetype-cdi
camel-archetype-web
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Hello Service
● Create the Camel projects
● Docker
● OpenShift v3
● More Information
Static
● camel-archetype-cdi camel-archetype-web
Java Standalone Apache Tomcat
from timer
to http
to log
from servlet
transform
HTTP 8080
hostname:port
is static / hardcoded
Dynamic
● camel-archetype-cdi camel-archetype-web
Java Standalone Apache Tomcat
from timer
to http
to log
from servlet
transform
Service
Kubernetes
Service
What is a Kubernetes Service
● Network Connection to one or more Pods
● Own fixed IP address and port
http://fabric8.io/guide/services.html
http://kubernetes.io/v1.1/docs/user-guide/services.html
What is a Kubernetes Service
● kube-proxy on client
http://fabric8.io/guide/services.html
http://kubernetes.io/v1.1/docs/user-guide/services.html
Java Standalone Apache Tomcat
from timer
to http
to log
from servlet
transform
kube-proxy
Kubernetes
Master
service
changes
Service
enlist
Define Kubernetes Service
● Use fabric8
command
Apache Tomcat
from servlet
transform
Service
Define Kubernetes Service
● Defined in pom.xml in <properties>
Apache Tomcat
from servlet
transform
Service
Container Port = Inside Docker Container
(e.g. the port of Apache Tomcat)
Service Port = Outside
Consumers of Service to use
Name of service
Generated kubernetes.json
Apache Tomcat
from http
choice
setBody
Service
Use Kubernetes Services
Java Standalone
from timer
to http
to log
● Environment Variables
● Hostname
● Port
Injected by Kubernetes
when starting a pod
Camel - Use Kubernetes Service
● Use {{service:name}} in Camel
Java Standalone
from timer
to http
to log
Microservice Demo - Ready for launch!
● camel-archetype-cdi camel-archetype-web
Java Standalone Apache Tomcat
from timer
to http
to log
from http
transform
Service
Service defined
Ready to deploy to Kubernetes
Deploy - myweb
● mvn -Pf8-local-deploy
Apache Tomcat
from http
transform
Service
Deploy - camel-archetype-cdi
● mvn -Pf8-local-deploy
Java Standalone
from timer
to http
to log
fabric8 web console
● http://fabric8.vagrant.f8
OpenShift 3 CLI
● oc get pods
docker CLI is also possible
docker images
docker ps
OpenShift 3 CLI
● oc get services
OpenShift 3 CLI
● oc logs -f <pod-name>
OpenShift 3 CLI
● oc get routes
Scaling up / down
● change controller replicas
Scaling up / down
● Service Load Balancing
Agenda
● What is Apache Camel?
● Camel Microservices
● Demo
● Hello Service
● Create the Camel projects
● Docker
● OpenShift v3
● More Information
More information
● Apache Camel Microservices
● http://camel.apache.org/camel-boot
● Fabric8
● http://fabric8.io
● chat room #fabric8 on freenode
● Medium Fabric8 (blogs and videos)
● https://medium.com/fabric8-io

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
An Intro into webpack
An Intro into webpackAn Intro into webpack
An Intro into webpack
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021Developing Terraform Modules at Scale - HashiTalks 2021
Developing Terraform Modules at Scale - HashiTalks 2021
 
Terraform
TerraformTerraform
Terraform
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
Introduction to Helm
Introduction to HelmIntroduction to Helm
Introduction to Helm
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Helm 3
Helm 3Helm 3
Helm 3
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...Best Practices for Middleware and Integration Architecture Modernization with...
Best Practices for Middleware and Integration Architecture Modernization with...
 
Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetes
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
 
Practical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingPractical Design Patterns in Docker Networking
Practical Design Patterns in Docker Networking
 

Andere mochten auch

Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
FuseSource.com
 

Andere mochten auch (8)

Realtime analytics with Flink and Druid
Realtime analytics with Flink and DruidRealtime analytics with Flink and Druid
Realtime analytics with Flink and Druid
 
Microservices with Apache Camel
Microservices with Apache CamelMicroservices with Apache Camel
Microservices with Apache Camel
 
Integrating Microservices with Apache Camel
Integrating Microservices with Apache CamelIntegrating Microservices with Apache Camel
Integrating Microservices with Apache Camel
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
Getting started with Apache Camel - May 2013
Getting started with Apache Camel - May 2013Getting started with Apache Camel - May 2013
Getting started with Apache Camel - May 2013
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration library
 
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 

Ähnlich wie Developing Microservices with Apache Camel

Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesRiga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Claus Ibsen
 

Ähnlich wie Developing Microservices with Apache Camel (20)

Integration made easy with Apache Camel
Integration made easy with Apache CamelIntegration made easy with Apache Camel
Integration made easy with Apache Camel
 
Microservices with apache_camel_barcelona
Microservices with apache_camel_barcelonaMicroservices with apache_camel_barcelona
Microservices with apache_camel_barcelona
 
Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014
 
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
murakumo Cloud Controller
murakumo Cloud Controllermurakumo Cloud Controller
murakumo Cloud Controller
 
Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus Ibsen
 
Getting Started with Apache Camel - Malmo JUG - March 2013
Getting Started with Apache Camel - Malmo JUG - March 2013Getting Started with Apache Camel - Malmo JUG - March 2013
Getting Started with Apache Camel - Malmo JUG - March 2013
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013
 
ApacheCon NA - Apache Camel K: a cloud-native integration platform
ApacheCon NA - Apache Camel K: a cloud-native integration platformApacheCon NA - Apache Camel K: a cloud-native integration platform
ApacheCon NA - Apache Camel K: a cloud-native integration platform
 
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesRiga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
 
apachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdfapachecamelk-april2019-190409093034.pdf
apachecamelk-april2019-190409093034.pdf
 
Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp Nomad
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
 
Low Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdfLow Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdf
 

Mehr von Claus Ibsen

Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Claus Ibsen
 

Mehr von Claus Ibsen (19)

Camel JBang - Quarkus Insights.pdf
Camel JBang - Quarkus Insights.pdfCamel JBang - Quarkus Insights.pdf
Camel JBang - Quarkus Insights.pdf
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel
 
Camel Day Italy 2021 - What's new in Camel 3
Camel Day Italy 2021 - What's new in Camel 3Camel Day Italy 2021 - What's new in Camel 3
Camel Day Italy 2021 - What's new in Camel 3
 
DevNation Live 2020 - What's new with Apache Camel 3
DevNation Live 2020 - What's new with Apache Camel 3DevNation Live 2020 - What's new with Apache Camel 3
DevNation Live 2020 - What's new with Apache Camel 3
 
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
Red Hat Nordics 2020 - Apache Camel 3 the next generation of enterprise integ...
 
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integrationSouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
SouJava May 2020: Apache Camel 3 - the next generation of enterprise integration
 
Apache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel QuarkusApache Camel v3, Camel K and Camel Quarkus
Apache Camel v3, Camel K and Camel Quarkus
 
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)
 
Serverless integration with Knative and Apache Camel on Kubernetes
Serverless integration with Knative and Apache Camel on KubernetesServerless integration with Knative and Apache Camel on Kubernetes
Serverless integration with Knative and Apache Camel on Kubernetes
 
Apache Camel K - Fredericia
Apache Camel K - FredericiaApache Camel K - Fredericia
Apache Camel K - Fredericia
 
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and KubernetesJEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
 
Camel riders in the cloud
Camel riders in the cloudCamel riders in the cloud
Camel riders in the cloud
 
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
Meetup Melbourne August 2017 - Agile Integration with Apache Camel microservi...
 
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration library
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the box
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 

Kürzlich hochgeladen

6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 

Kürzlich hochgeladen (20)

Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 

Developing Microservices with Apache Camel

  • 1. Microservices with Apache Camel Claus Ibsen (@davsclaus) Principal Software Engineer, Red Hat
  • 3. Your Speaker ● Principal Software Engineer at Red Hat ● Apache Camel ● 7 years working with Camel ● Author of Camel in Action books ● Contact ● E-mail: cibsen@redhat.com ● Twitter: @davsclaus ● Blog: http://davsclaus.com
  • 5. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Standalone ● with Docker ● with OpenShift 3 / Kubernetes ● More Information
  • 6. What is Apache Camel? ● Quote from the website
  • 7. What is Apache Camel? ● Integration Framework
  • 8. What is Apache Camel? ● What is Enterprise Integration Patterns? It's a book
  • 9. What is Apache Camel? ● Enterprise Integration Patterns http://camel.apache.org/eip
  • 10. What is Apache Camel? ● EIP - Content Based Router
  • 11. What is Apache Camel? from newOrder
  • 12. What is Apache Camel? from newOrder choice
  • 13. What is Apache Camel? from newOrder choice when isWidget to widget
  • 14. What is Apache Camel? from newOrder choice when isWidget to widget otherwise to gadget
  • 15. What is Apache Camel? from(newOrder) choice when(isWidget) to(widget) otherwise to(gadget)
  • 16. What is Apache Camel? from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget);
  • 17. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget);
  • 18. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget);
  • 19. What is Apache Camel? Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget);
  • 20. What is Apache Camel? ● Java Code public void configure() throws Exception { Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget) .end(); }
  • 21. What is Apache Camel? ● Java Code import org.apache.camel.Endpoint; import org.apache.camel.Predicate; import org.apache.camel.builder.RouteBuilder; public class MyRoute extends RouteBuilder { public void configure() throws Exception { Endpoint newOrder = endpoint("activemq:queue:newOrder"); Predicate isWidget = xpath("/order/product = 'widget'"); Endpoint widget = endpoint("activemq:queue:widget"); Endpoint gadget = endpoint("activemq:queue:gadget"); from(newOrder) .choice() .when(isWidget).to(widget) .otherwise().to(gadget) .end(); } }
  • 22. What is Apache Camel? ● Camel Java DSL import org.apache.camel.builder.RouteBuilder; public class MyRoute extends RouteBuilder { public void configure() throws Exception { from("activemq:queue:newOrder") .choice() .when(xpath("/order/product = 'widget'")) .to("activemq:queue:widget") .otherwise() .to("activemq:queue:gadget") .end(); } }
  • 23. What is Apache Camel? ● Camel XML DSL <route> <from uri="activemq:queue:newOrder"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route>
  • 24. What is Apache Camel? ● Endpoint as URIs <route> <from uri="file:inbox/orders"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route> use file instead
  • 25. What is Apache Camel? ● Endpoint as URIs <route> <from uri="file:inbox/orders?delete=true"/> <choice> <when> <xpath>/order/product = 'widget'</xpath> <to uri="activemq:queue:widget"/> </when> <otherwise> <to uri="activemq:queue:gadget"/> </otherwise> </choice> </route> parameters
  • 26. What is Apache Camel? ● Java DSL is just Java
  • 27. What is Apache Camel? ● XML DSL is just XML ● … with XSD schema for validation/tooling
  • 28. What is Apache Camel? ● Camel's Architecture
  • 29. What is Apache Camel? 150+ Components
  • 30. What is Apache Camel? 150+ Components
  • 31.
  • 32. +
  • 33. + +
  • 34. + + +
  • 36. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Standalone ● with Docker ● with OpenShift 3 / Kubernetes ● More Information
  • 37. Running Camel as Microservices Standalone Web Application Camel Spring XML Apache Karaf Camel Spring Boot Wildfly (wildfly-camel) Camel CDI vert.x (vertx-camel) Camel Guice Rest DSL
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 49. Camel Microservices ● Apache Karaf Apache Karaf (boot)
  • 50. Camel Microservices ● Apache Karaf Karaf Features OSGi Bundles Apache Karaf (boot)
  • 51. Camel Microservices ● Apache Karaf Karaf Features OSGi Bundles Apache Karaf (boot) Karaf Maven Plugin
  • 52. Camel Microservices ● Apache Karaf Karaf Features OSGi Bundles Apache Karaf (boot) Karaf Maven Plugin Custom Karaf (with your app) tar / zip file
  • 53. Camel Microservices ● Rest DSL ● Use Rest verbs GET POST PUT ... ● Swagger API ● Pluggable Transport
  • 57. Rest DSL example - add Swagger API
  • 58. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Hello Service ● Create the Camel projects ● Docker ● OpenShift v3 ● More Information
  • 59. Demo - Hello Service Hello Service
  • 60. Demo - Hello Service Hello Service Hi I am New York. Hello Claus how are you today? name=Claus
  • 61. Demo - Hello Service Java Standalone Apache Tomcat HTTP Hello Service
  • 62. Demo - Hello Service Java Standalone Apache Tomcat HTTP from timer to http to log from servlet transform Hello Service
  • 63. Demo - Create the Camel Projects Java Standalone Apache Tomcat HTTP from timer to http to log from servlet transform Hello Service camel-archetype-cdi camel-archetype-web
  • 64. Demo - Create the Camel Projects ● Using Command Shell ● From Eclipse
  • 65. Demo - Create the Camel Projects ● camel-archetype-web Ready to use out of the box
  • 66. Demo - Create the Camel Projects ● camel-archetype-cdi Not ready We need to change he code
  • 67. Demo - Create the Camel Projects ● add netty4-http endpoint CMD + ALT 4
  • 68. Demo - Create the Camel Projects ● configure netty4-http endpoint
  • 69. Demo - Create the Camel Projects ● change route to call netty
  • 70. Demo - Create the Camel Projects ● change bean to return a name
  • 71. Demo - Overview ● camel-archetype-cdi camel-archetype-web Java Standalone Apache Tomcat HTTP 8080 from timer to http to log from http transform We are ready to run standalone
  • 72. Demo - Running Standalone mvn camel:run
  • 73. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Hello Service ● Create the Camel projects ● Docker ● OpenShift v3 ● More Information
  • 74. Camel and Docker Maven Project Docker Maven Plugin Docker Image build
  • 75. Add Docker from Command Line
  • 76. Add Docker from Eclipse / IDEA CMD + ALT 4
  • 77. Docker Maven Plugin in pom.xml
  • 78. Build Docker Containers ● mvn clean install docker:build
  • 79. Build Docker Containers ● After build images in local Docker repository camel-archetype-cdi camel-archetype-web
  • 80. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Hello Service ● Create the Camel projects ● Docker ● OpenShift v3 ● More Information
  • 81. Static ● camel-archetype-cdi camel-archetype-web Java Standalone Apache Tomcat from timer to http to log from servlet transform HTTP 8080 hostname:port is static / hardcoded
  • 82. Dynamic ● camel-archetype-cdi camel-archetype-web Java Standalone Apache Tomcat from timer to http to log from servlet transform Service Kubernetes Service
  • 83. What is a Kubernetes Service ● Network Connection to one or more Pods ● Own fixed IP address and port http://fabric8.io/guide/services.html http://kubernetes.io/v1.1/docs/user-guide/services.html
  • 84. What is a Kubernetes Service ● kube-proxy on client http://fabric8.io/guide/services.html http://kubernetes.io/v1.1/docs/user-guide/services.html Java Standalone Apache Tomcat from timer to http to log from servlet transform kube-proxy Kubernetes Master service changes Service enlist
  • 85. Define Kubernetes Service ● Use fabric8 command Apache Tomcat from servlet transform Service
  • 86. Define Kubernetes Service ● Defined in pom.xml in <properties> Apache Tomcat from servlet transform Service Container Port = Inside Docker Container (e.g. the port of Apache Tomcat) Service Port = Outside Consumers of Service to use Name of service
  • 87. Generated kubernetes.json Apache Tomcat from http choice setBody Service
  • 88. Use Kubernetes Services Java Standalone from timer to http to log ● Environment Variables ● Hostname ● Port Injected by Kubernetes when starting a pod
  • 89. Camel - Use Kubernetes Service ● Use {{service:name}} in Camel Java Standalone from timer to http to log
  • 90. Microservice Demo - Ready for launch! ● camel-archetype-cdi camel-archetype-web Java Standalone Apache Tomcat from timer to http to log from http transform Service Service defined Ready to deploy to Kubernetes
  • 91. Deploy - myweb ● mvn -Pf8-local-deploy Apache Tomcat from http transform Service
  • 92. Deploy - camel-archetype-cdi ● mvn -Pf8-local-deploy Java Standalone from timer to http to log
  • 93. fabric8 web console ● http://fabric8.vagrant.f8
  • 94. OpenShift 3 CLI ● oc get pods docker CLI is also possible docker images docker ps
  • 95. OpenShift 3 CLI ● oc get services
  • 96. OpenShift 3 CLI ● oc logs -f <pod-name>
  • 97. OpenShift 3 CLI ● oc get routes
  • 98. Scaling up / down ● change controller replicas
  • 99. Scaling up / down ● Service Load Balancing
  • 100. Agenda ● What is Apache Camel? ● Camel Microservices ● Demo ● Hello Service ● Create the Camel projects ● Docker ● OpenShift v3 ● More Information
  • 101. More information ● Apache Camel Microservices ● http://camel.apache.org/camel-boot ● Fabric8 ● http://fabric8.io ● chat room #fabric8 on freenode ● Medium Fabric8 (blogs and videos) ● https://medium.com/fabric8-io