Managing your camels in the cloud with CI/CD
Transcript of Managing your camels in the cloud with CI/CD
![Page 1: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/1.jpg)
Managing Your Camels in the Cloud
@christianposta Principal Architect at Red Hat 6/29/16
![Page 2: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/2.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, others
• Worked with large Microservices, web-scale, unicorn company
• Blogger, speaker about DevOps, integration, and microservices
![Page 3: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/3.jpg)
Do we need “integration?”
What kind of challenges are we going to run into?
How do we manage our integrations and microservices?
We’re off to do Microservices!
![Page 4: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/4.jpg)
Infrastructure for scale
Organizational structure
Identify a useful domain model with boundaries
Transformation Challenges
![Page 5: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/5.jpg)
Domain Complexity • 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 6: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/6.jpg)
![Page 7: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/7.jpg)
• Where we went wrong
• Architectural concepts for scaling
• Domain Driven Design, CQRS, Event Sourcing
• Monolith->Microservices hands-on
• WildFly Swarm, Spring Boot, Apache Camel, Apache Kafka, Debezium, Docker, Kubernetes, OpenShift
SOA to Microservices: modernization with microservices and containers
Thursday, 3:30p-4:30p room 2022
![Page 8: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/8.jpg)
Do we need integration?
• REST, RPC
• Messaging (ActiveMQ, JMS, AMQP, STOMP, Kafka, etc)
• Legacy (SOAP, mainframe, file processing, proprietary)
• Managed file processing
• Streaming
• Message transformation
• EIPs
![Page 9: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/9.jpg)
Do we need integraton?
![Page 10: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/10.jpg)
Real developers ride camels!
![Page 11: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/11.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 12: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/12.jpg)
• Dynamic routing
• Powerful testing/mocking framework
• Circuit breakers, fallbacks, automatic retries, back-off
• Idempotent consumers
• Backpressure mechanisms
• Beautiful REST DSL with built in Swagger support
Camel for microservices!
![Page 13: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/13.jpg)
![Page 14: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/14.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 15: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/15.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 16: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/16.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 17: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/17.jpg)
• How to run them all locally?
• How to integrate them?
• How to package them (dependency management)
• How to test?
• Vagrant? VirtualBox? VMs?
• Specify configuration
• Process isolation
• Service discovery
Problems developing microservices
![Page 18: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/18.jpg)
![Page 19: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/19.jpg)
Linux Containers
![Page 20: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/20.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 21: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/21.jpg)
Fuse integration services
https://docs.openshift.com/enterprise/3.1/using_images/xpaas_images/fuse.html
![Page 22: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/22.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 23: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/23.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 24: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/24.jpg)
![Page 25: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/25.jpg)
![Page 26: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/26.jpg)
![Page 27: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/27.jpg)
Microservices Platform on Kubernetes/OpenShift
![Page 28: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/28.jpg)
![Page 29: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/29.jpg)
![Page 30: Managing your camels in the cloud with CI/CD](https://reader031.fdocuments.net/reader031/viewer/2022022203/5876fdf61a28abf3398b6b91/html5/thumbnails/30.jpg)
Christian Posta Principal Middleware Specialist/Architect
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: [email protected]
Questions, Discussion, Demo!