in the belly of the
Brought to you by...
What is... 
Server for running and managing Linux 
containers.
What are Linux containers? 
Para-virtualized Linux instances.
Why not regular virtualization? 
● slooooooow 
● gigantic images 
● aggressive resource allocation 
● bad API
Key concepts 
● image (immutable, no state) 
● container (has state) 
Container is the running image.
Docker awesomeness #1 
Commands.
Docker awesomeness #2 
WAR 
Tomcat 
JRE 
Ubuntu base 
Layers.
Docker awesomeness #3 
Registries.
Docker awesomeness #4 
Build once. Deploy everywhere!
Dockerfiles 
FROM ubuntu 
EXPOSE 8080 
RUN apt-get install java 
RUN mkdir /jars 
ADD target/app.jar /jars/ 
CMD ["java", ...
Create new image in the local repo 
$ docker build -t com.me/app:1.0 
$ docker run -t com.me/app:1.0
Apache Camel 
Framework that routes messages like crazy.
How to deploy Camel? 
● Karaf (JBoss Fuse, ServiceMix, Talend ESB) 
● Tomcat 
● WildFly (JBoss EAP) 
● standalone/embeded ...
Camel and Docker 
How to split it? What should I dockerize?
Messaging architecture in a nutshell
Concrete messaging architecture
Dockerized example
In-endpoint route 
from(“netty-http:http://0.0.0.0:18080”). 
setBody(randomUUID()). 
inOnly("jms:invoices"); 
... 
new Act...
Processing route 
from("jms:invoices"). 
setBody(). 
groovy("new Invoice(request.body,currentTimeMillis())"). 
to("mongodb...
How can I get database images? 
docker run -d -p 27017:27017 
--name mongodb dockerfile/mongodb 
Provided by database 
com...
How can I put fresh jar into image? 
Docker Maven plugin by Roland ‘Jolokia’ Huß
How to bootstrap Camel? 
● no Karaf bundle activators 
● no server (Tomcat, etc.) 
● how can we start CamelContext?
Custom class with the main method
Spring Boot for Camel 
http://projects.spring.io/spring-boot
Camel + Spring Boot: step #1 
Take a Spring Boot fat jar.
Camel + Spring Boot: step #2 
Add camel-spring-boot jar to your classpath.
Camel + Spring Boot: step #3 
Add Camel route to your classpath.
Camel + Spring Boot: step #4 
Dockerize your fat jar and run it!
ENV-centric runtime configuration 
# override endpoint definition via ENV variable 
docker run -e FROM=jms:queue -it my-sp...
Monitoring 
Expose JMX via REST with the Jolokia base 
image.
Kubernetes 
● orchestration of many Docker containers 
● ...and many Docker servers! 
● logical container groups (pods) 
●...
Thank you!
Apache Camel in the belly of the Docker whale
Nächste SlideShare
Wird geladen in …5
×

Apache Camel in the belly of the Docker whale

22.277 Aufrufe

Veröffentlicht am

Apache Camel in the belly of the Docker whale

Veröffentlicht in: Technologie

Apache Camel in the belly of the Docker whale

  1. 1. in the belly of the
  2. 2. Brought to you by...
  3. 3. What is... Server for running and managing Linux containers.
  4. 4. What are Linux containers? Para-virtualized Linux instances.
  5. 5. Why not regular virtualization? ● slooooooow ● gigantic images ● aggressive resource allocation ● bad API
  6. 6. Key concepts ● image (immutable, no state) ● container (has state) Container is the running image.
  7. 7. Docker awesomeness #1 Commands.
  8. 8. Docker awesomeness #2 WAR Tomcat JRE Ubuntu base Layers.
  9. 9. Docker awesomeness #3 Registries.
  10. 10. Docker awesomeness #4 Build once. Deploy everywhere!
  11. 11. Dockerfiles FROM ubuntu EXPOSE 8080 RUN apt-get install java RUN mkdir /jars ADD target/app.jar /jars/ CMD ["java", "-jar", "/jars/app.jar"] “Recipes” for the new images.
  12. 12. Create new image in the local repo $ docker build -t com.me/app:1.0 $ docker run -t com.me/app:1.0
  13. 13. Apache Camel Framework that routes messages like crazy.
  14. 14. How to deploy Camel? ● Karaf (JBoss Fuse, ServiceMix, Talend ESB) ● Tomcat ● WildFly (JBoss EAP) ● standalone/embeded ● Akka plugin ● Grails plugin ● Spring Boot
  15. 15. Camel and Docker How to split it? What should I dockerize?
  16. 16. Messaging architecture in a nutshell
  17. 17. Concrete messaging architecture
  18. 18. Dockerized example
  19. 19. In-endpoint route from(“netty-http:http://0.0.0.0:18080”). setBody(randomUUID()). inOnly("jms:invoices"); ... new ActiveMQConnectionFactory("tcp://amqbroker:6162")
  20. 20. Processing route from("jms:invoices"). setBody(). groovy("new Invoice(request.body,currentTimeMillis())"). to("mongodb:mongo?...operation=insert"); ... new ActiveMQConnectionFactory("tcp://amqbroker:6162"); ... new MongoClient("mongodb");
  21. 21. How can I get database images? docker run -d -p 27017:27017 --name mongodb dockerfile/mongodb Provided by database community/vendor.
  22. 22. How can I put fresh jar into image? Docker Maven plugin by Roland ‘Jolokia’ Huß
  23. 23. How to bootstrap Camel? ● no Karaf bundle activators ● no server (Tomcat, etc.) ● how can we start CamelContext?
  24. 24. Custom class with the main method
  25. 25. Spring Boot for Camel http://projects.spring.io/spring-boot
  26. 26. Camel + Spring Boot: step #1 Take a Spring Boot fat jar.
  27. 27. Camel + Spring Boot: step #2 Add camel-spring-boot jar to your classpath.
  28. 28. Camel + Spring Boot: step #3 Add Camel route to your classpath.
  29. 29. Camel + Spring Boot: step #4 Dockerize your fat jar and run it!
  30. 30. ENV-centric runtime configuration # override endpoint definition via ENV variable docker run -e FROM=jms:queue -it my-springboot-camel-app # run with the given Spring profile docker run -e spring.profiles.active=production -it my-springboot- camel-app
  31. 31. Monitoring Expose JMX via REST with the Jolokia base image.
  32. 32. Kubernetes ● orchestration of many Docker containers ● ...and many Docker servers! ● logical container groups (pods) ● auto-scaling ● wiring your Docker stuff together
  33. 33. Thank you!

×