![Page 1: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/1.jpg)
CLOUD NATIVE CAMEL RIDING WITH KUBERNETES AND OPENSHIFT
@christianposta 17 June 2016
![Page 2: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/2.jpg)
Ifchangeishappeningontheoutsidefasterthanontheinsidetheendisinsight.
Jack Welch, former CEO, GE
Company listed on Standard & Poors life expectancy
![Page 3: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/3.jpg)
Do we need “integration?”
What kind of challenges are we going to run into?
Where do Containers fit into this?
WE’RE OFF TO DO MICROSERVICES!
![Page 4: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/4.jpg)
Christian Posta Principal Middleware Architect @ Red Hat
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: [email protected]
• “Microservices for Java developers” (6/2016)
• Committer Apache Camel, ActiveMQ, Fabric8
• Worked with large Microservices, web-scale,
unicorn company
• Blogger, speaker about DevOps, integration,
and microservices
![Page 5: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/5.jpg)
• Single, self-contained, autonomous
• Isolated and Resilient to faults
• Faster software delivery • Own their own data • Easier to understand
individually • Scalability • Right technology for the
problem • Test individual services • Individual deployments
MICROSERVICES
![Page 6: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/6.jpg)
Infrastructure for scale
Organizational structure
Identify a useful domain model with boundaries
TRANSFORMATION CHALLENGES
![Page 7: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/7.jpg)
![Page 8: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/8.jpg)
DOMAIN COMPLEXITY IS REAL
• Break things into smaller, understandable models
• Surround a model and its “context” with a boundary
• Implement the model in code or get a new model
• Explicitly map between different contexts
• Model transactional boundaries as aggregates
![Page 9: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/9.jpg)
Book checkout / purchase Title Search
Recommendations
Weekly reporting
![Page 10: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/10.jpg)
![Page 11: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/11.jpg)
DO WE NEED INTEGRATON?
• REST, RPC
• Messaging (ActiveMQ, JMS, AMQP, STOMP, Kafka, etc)
• Legacy (SOAP, mainframe, file processing, proprietary)
• Managed file processing
• Streaming
• Message transformation
• EIPs
![Page 12: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/12.jpg)
DO WE NEED INTEGRATON?
![Page 13: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/13.jpg)
REAL DEVELOPERS RIDE CAMELS!
![Page 14: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/14.jpg)
• Small Java library
• Very popular (200+ components for “dumb pipes”)
• Powerful EIPs (routing, transformation, error handling)
• Distributed-systems swiss-army knife!
• Declarative DSL
• Embeddable into any JVM (EAP, Karaf, Tomcat, Spring Boot, Dropwizard, Wildfly Swarm, no container, etc)
APACHE CAMEL
![Page 15: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/15.jpg)
INTEGRATION HEAVY LIFTING: APACHE CAMEL
![Page 16: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/16.jpg)
• Automatic retries, back-off algorithms
• Dynamic routing
• Powerful testing/mocking framework
• Circuit breakers, fallbacks
• Idempotent consumers
• Backpressure mechanisms
• Beautiful REST DSL with built in Swagger support
CAMEL FOR RESILIENT MICROSERVICES
![Page 17: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/17.jpg)
![Page 18: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/18.jpg)
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”); }
EXPOSE REST END POINT
![Page 19: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/19.jpg)
public class OrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { from(“jms:topic:foo”)
.hystrix() .to(“http://fooservice/”).onFallback() .transform().constant(“fallback foo!”).end()
}
CIRCUIT BREAKER/FALLBACK
![Page 20: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/20.jpg)
public class OrderProcessorRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { from(“jms:topic:foo”)
.idempotentConsumer(header(“fooMessageId”), memoryCache).to(“http://fooservice/”).log(“got response ${body}”);
}
IDEMPOTENT CONSUMER
![Page 21: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/21.jpg)
![Page 22: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/22.jpg)
• How to run them all locally?
• How to package them (dependency management)
• How to test?
• Vagrant? VirtualBox? VMs?
• Specify configuration
• Process isolation
• Service discovery
• Multiple versions?
PROBLEMS DEVELOPING MICROSERVICES
![Page 23: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/23.jpg)
LINUX CONTAINERS
![Page 24: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/24.jpg)
RED HAT OPENSHIFT
• Developer focused workflow
• Enterprise ready, supported
• Higher level abstraction above containers for delivering
technology and business value
• Build/deployment triggers
• Software Defined Networking (SDN)
• Docker native format/packaging
• CLI/Web based tooling
![Page 25: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/25.jpg)
FUSE INTEGRATION SERVICES
https://docs.openshift.com/enterprise/3.1/using_images/xpaas_images/fuse.html
![Page 26: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/26.jpg)
• Set of tools for integration developers
• Package your Fuse/Camel services as Docker images
• Run locally on CDK (container development kit)
• Manage them with Kubernetes/OpenShift
• Flat class loader JVMs
• Supports Spring, CDI, Blueprint
• Plugs-in to your existing build/release ecosystem (Jenkins/Maven/Nexus/Gitlab,etc)
FUSE INTEGRATION SERVICES
![Page 27: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/27.jpg)
• How to run them all locally?
• How to package them
• How to test?
• Vagrant? VirtualBox? VMs?
• Specify configuration
• Process isolation
• Service discovery
• Multiple versions?
PROBLEMS DEVELOPING MICROSERVICES: SOLVED
![Page 28: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/28.jpg)
![Page 29: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/29.jpg)
![Page 30: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/30.jpg)
![Page 31: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/31.jpg)
MICROSERVICES PLATFORM ON KUBERNETES/OPENSHIFT
![Page 32: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/32.jpg)
![Page 33: Microservices with Apache Camel, DDD, and Kubernetes](https://reader034.vdocuments.us/reader034/viewer/2022052212/5876fe111a28abf3398b6be5/html5/thumbnails/33.jpg)
Christian Posta Principal Middleware Specialist/Architect
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: [email protected]
Questions, Discussion, Demo!