Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
#microservices with
Apache Camel, Docker and
Fabric8v2
Christian Posta
Principal Middleware Specialist/Architect
Blog: http://blog.christianposta.com
Twitter: @christianposta
Em...
• Microservices: the good, the bad
• Do you even need integration?
• Real developers ride Camels 
• Microservices the Doc...
Microservices: the good, the bad
• Agile
• SOA principles
• Domain Driven Design
• Hexagonal Architectures
• Pipes and Filters
• Actor Model
• SEDA
Microse...
A way to organize teams that mimic the
structure of an organization for greater
autonomy and reduced cross-team
synchroniz...
• Faster software delivery
• Potential for faster innovation
• Scale easier
• Right technology stack for the problem
• Gro...
• System complexity
• Operational complexity
• Testing is harder across services
• Security
• It’s freakin hard
• Resource...
1. Do you have a scaling problem?
2. You need to deliver software much faster?
3. Do you have organizational complexity?
W...
• Understanding of modularity, API design
• Small, cross-functional teams (pizza box)
• Self service access to infrastruct...
Do YOU want to do Microservices?
Microservices Envy:
http://www.thoughtworks.com/radar/techniques/microservice-envy
You’re not going to do microservices
ht...
Do you even need integration?
Yes.
1
Enterprise Service Bus?
Hexagonal architecture
Microservices
Real developers ride
Camels
Real developers ride Camels!
Enterprise Integration Patterns
http://camel.apache.org/eip
Heavy Lifting: Camel for Microservices
• Dynamic routing options
• REST DSL
• Backpressure mechanisms
• Circuit Breaker
Heavy Lifting: Camel for Microservices
• “Smart endpoints, dumb pipes”
• Endpoint does one thing well
• Metadata used for further routing
• Really “dynamic” with...
REST DSL
public class OrderProcessorRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception...
• Throttle EIP
• http://camel.apache.org/throttler.html
• Blocking SEDA Queue
• from(“seda:name?size=100&blockWhenFull=tru...
Circuit breaker
public class OrderProcessorRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Ex...
More Information
Microservices the Docker way
with Fabric8
• Implemented with Zookeeper and git
• Intended to be used with a dynamic
JVM/Apache Karaf
• Profiles store configuration,...
• Implemented with Docker and Kubernetes
• Use any JVM (or any technology)
• Docker images, encourage immutable, well-
def...
Kubernetes
Master
RHEL Atomic
Minion Minion Minion Minion Minion
RHEL Atomic
Minion
Master Master
etcd etcd etcd
Jube
Kube...
• Docker for packaging
• Docker/linux containers for process isolation
• Kubernetes for container orchestration (start,
st...
CI/CD apps API management iPaaS Manage/Monitor
Some Hawt Consoles
• Console
• Docker Maven Plugin
• Fabric8 Maven Plugin
• Dependency Injection (of Kube services too!)
• Spring
• CDI
• Jav...
Questions?
Blog: http://blog.christianposta.com
Twitter: @christianposta
Email: christian@redhat.com
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
Upcoming SlideShare
Loading in …5
×

Microservices with Apache Camel, Docker and Fabric8 v2

7,490 views

Published on

My talk from Red Hat Summit 2015 about the pros/cons of microservices, how integration is a strong requirement for doing distributed systems designs, and how open source projects like Apache Camel, Docker, Kubernetes, OpenShift and Fabric8 can help simplify and manage microservice environments

Published in: Software
  • Be the first to comment

Microservices with Apache Camel, Docker and Fabric8 v2

  1. 1. #microservices with Apache Camel, Docker and Fabric8v2
  2. 2. Christian Posta Principal Middleware Specialist/Architect Blog: http://blog.christianposta.com Twitter: @christianposta Email: christian@redhat.com • Committer on Apache Camel, Apache ActiveMQ, Fabric8 • Recovering consultant • Spent lot of time working with one of the largest Microservices, web- scale, unicorn companies • Frequent blogger and speaker about open-source, cloud, and microservices
  3. 3. • Microservices: the good, the bad • Do you even need integration? • Real developers ride Camels  • Microservices the Docker way with Fabric8 • Questions / Demo Agenda
  4. 4. Microservices: the good, the bad
  5. 5. • Agile • SOA principles • Domain Driven Design • Hexagonal Architectures • Pipes and Filters • Actor Model • SEDA Microservices not really new, per-se
  6. 6. A way to organize teams that mimic the structure of an organization for greater autonomy and reduced cross-team synchronization for the purposes of scalability, faster solution delivery, and ability to manage complexity at the expense of known tradeoffs. So what is “Microservices”?
  7. 7. • Faster software delivery • Potential for faster innovation • Scale easier • Right technology stack for the problem • Grok services easier • Test individual services easier • Individual deployments
  8. 8. • System complexity • Operational complexity • Testing is harder across services • Security • It’s freakin hard • Resource overhead • Network overhead • Lack of tooling Drawbacks
  9. 9. 1. Do you have a scaling problem? 2. You need to deliver software much faster? 3. Do you have organizational complexity? When do you do microservices:
  10. 10. • Understanding of modularity, API design • Small, cross-functional teams (pizza box) • Self service access to infrastructure • Strong automation capabilities • Mature CI/CD practices Foundations of Microservices
  11. 11. Do YOU want to do Microservices?
  12. 12. Microservices Envy: http://www.thoughtworks.com/radar/techniques/microservice-envy You’re not going to do microservices http://christianposta.com/blog/not-gonna-happen
  13. 13. Do you even need integration?
  14. 14. Yes.
  15. 15. 1 Enterprise Service Bus?
  16. 16. Hexagonal architecture
  17. 17. Microservices
  18. 18. Real developers ride Camels
  19. 19. Real developers ride Camels!
  20. 20. Enterprise Integration Patterns http://camel.apache.org/eip
  21. 21. Heavy Lifting: Camel for Microservices
  22. 22. • Dynamic routing options • REST DSL • Backpressure mechanisms • Circuit Breaker Heavy Lifting: Camel for Microservices
  23. 23. • “Smart endpoints, dumb pipes” • Endpoint does one thing well • Metadata used for further routing • Really “dynamic” with rules engine (eg, Drools/BRMS) Dynamic Routing
  24. 24. REST DSL public class OrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { rest().post(“/order/socks”) .description(“New Order for pair of socks”) .consumes(“application/json”) .route() .to(“activemq:topic:newOrder”) .log(“received new order ${body.orderId}”) .to(“ibatis:storeOrder?statementType=Insert”); } }
  25. 25. • Throttle EIP • http://camel.apache.org/throttler.html • Blocking SEDA Queue • from(“seda:name?size=100&blockWhenFull=true) • Configure jetty/netty to use blocking acceptor queues • https://wiki.eclipse.org/Jetty/Howto/High_Load • Using Exception handling/retry and DLQ logic when getting flow controlled • http://camel.apache.org/error-handling-in-camel.html Backpressure with Camel
  26. 26. Circuit breaker public class OrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { from(“direct:someinterface”) .loadbalance() .circuitBreaker(3, 20000L, MyException.class) .to(“ibatis:storeOrder?statementType=Insert”); } }
  27. 27. More Information
  28. 28. Microservices the Docker way with Fabric8
  29. 29. • Implemented with Zookeeper and git • Intended to be used with a dynamic JVM/Apache Karaf • Profiles store configuration, metadata, end- state deployments • Networking, JVM isolation, orchestration, auto-scaling, health checks, cloud deployments: all up to you Fabric8 V1.x
  30. 30. • Implemented with Docker and Kubernetes • Use any JVM (or any technology) • Docker images, encourage immutable, well- defined, well-tested deployments • Provides networking, JVM isolation, orchestration, auto-scaling, health checks, cloud deployments Fabric8 V2
  31. 31. Kubernetes Master RHEL Atomic Minion Minion Minion Minion Minion RHEL Atomic Minion Master Master etcd etcd etcd Jube Kubernetes REST API v1 Webconsole Pre-packaged Apps Developer tools Java Libraries
  32. 32. • Docker for packaging • Docker/linux containers for process isolation • Kubernetes for container orchestration (start, stop, health check, replicas, service discovery) • Set of microservices/apps for • Management • Continuous Delivery • Integration (iPaaS) • Tools for Java Developers Fabric8 V2
  33. 33. CI/CD apps API management iPaaS Manage/Monitor Some Hawt Consoles
  34. 34. • Console • Docker Maven Plugin • Fabric8 Maven Plugin • Dependency Injection (of Kube services too!) • Spring • CDI • Java Libraries • Kubernetes fluent API • Arquillian plugins • Kubernetes Jolokia Fabric8 V2
  35. 35. Questions? Blog: http://blog.christianposta.com Twitter: @christianposta Email: christian@redhat.com

×