Managing Your Camels in the Cloud
@christianposta
Principal Architect at Red Hat
6/29/16
Christian Posta
Principal Middleware Architect @ Red Hat
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: christian@redhat.com
•  “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
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!
Infrastructure for scale
Organizational structure
Identify a useful domain model with boundaries
Transformation Challenges
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
•  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
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
Do we need integraton?
Real developers ride camels!
•  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
•  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!
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
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
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
•  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
Linux Containers
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
Fuse integration services
https://docs.openshift.com/enterprise/3.1/using_images/xpaas_images/fuse.html
•  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
•  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
Microservices Platform on Kubernetes/OpenShift
Christian Posta
Principal Middleware Specialist/Architect
Twitter: @christianposta
Blog: http://blog.christianposta.com
Email: christian@redhat.com
Questions, Discussion, Demo!

Managing your camels in the cloud with CI/CD

  • 1.
    Managing Your Camelsin the Cloud @christianposta Principal Architect at Red Hat 6/29/16
  • 2.
    Christian Posta Principal MiddlewareArchitect @ Red Hat Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com •  “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
  • 3.
    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!
  • 4.
    Infrastructure for scale Organizationalstructure Identify a useful domain model with boundaries Transformation Challenges
  • 5.
    Domain Complexity •  Breakthings 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
  • 7.
    •  Where wewent 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
  • 8.
    Do we needintegration? •  REST, RPC •  Messaging (ActiveMQ, JMS, AMQP, STOMP, Kafka, etc) •  Legacy (SOAP, mainframe, file processing, proprietary) •  Managed file processing •  Streaming •  Message transformation •  EIPs
  • 9.
    Do we needintegraton?
  • 10.
  • 11.
    •  Small Javalibrary •  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
  • 12.
    •  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!
  • 14.
    public class OrderProcessorRouteBuilderextends 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
  • 15.
    public class OrderProcessorRouteBuilderextends RouteBuilder { @Override public void configure() throws Exception { from(“jms:topic:foo”) .hystrix() .to(“http://fooservice/”) .onFallback() .transform().constant(“fallback foo!”) .end() } Circuit Breaker/fallback
  • 16.
    public class OrderProcessorRouteBuilderextends RouteBuilder { @Override public void configure() throws Exception { from(“jms:topic:foo”) .idempotentConsumer(header(“fooMessageId”), memoryCache) .to(“http://fooservice/”) .log(“got response ${body}”); } Idempotent consumer
  • 17.
    •  How torun 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
  • 19.
  • 20.
    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
  • 21.
  • 22.
    •  Set oftools 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
  • 23.
    •  How torun 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
  • 27.
    Microservices Platform onKubernetes/OpenShift
  • 30.
    Christian Posta Principal MiddlewareSpecialist/Architect Twitter: @christianposta Blog: http://blog.christianposta.com Email: christian@redhat.com Questions, Discussion, Demo!