Cloud Native Camel Design Patterns

Bilgin Ibryam
Bilgin IbryamConsultant • Architect • ASF Member • Author • Occasional Speaker um The Apache Software Foundation
Cloud Native
Camel Design Patterns
(Tips for Running Apache Camel on Kubernetes)
ApacheCon Europe
November 2016
Bilgin Ibryam
Cloud Native Camel Design Patterns2
Bilgin Ibryam
● Senior Middleware Architect at Red Hat UK
● Apache Isis Committer and PMC member
● Apache Camel Committer and PMC member
● Apache OFBiz Committer and PMC member
● Author of Camel Design Patterns (new)
● Author of Apache Camel Message Routing
● Twitter: @bibryam
● Email: bibryam@gmail.com
● Blog: http://ofbizian.com
● LinkedIn: http://www.linkedin.com/in/bibryam
Cloud Native Camel Design Patterns3
Before Cloud Native
Cloud Native Camel Design Patterns4
Trends in the IT Industry
● Application Infrastructure: Data Center, Hosted, Cloud
● Application Deployment: Physical, Virtual, Containers
● Application Architecture: Monolith, N-tier, Microservices
● Development Methodology: Waterfall, Agile, DevOps
And these trends do affect the way we design, develop and run Camel applications!
Cloud Native Camel Design Patterns5
What is Cloud Native?
A cloud-native application is a distributed application that runs on a cloud
infrastructure and is in its core scalable and resilient.
● Web-scale – originated from large cloud firms, such as Google, Amazon, Netflix, FB.
● The twelve-factor apps - a methodology for building apps for the Heroku platform.
● 13 factor apps, 14 factor apps – 12 is not enough, nor is 13...
● Cloud-aware or Cloud-ready – cannot benefit from all characteristics of the cloud.
● Cloud native – a marketing term used by Cloud Foundry.
● Cloud Native Computing Foundation - https://cncf.io - part of the Linux Foundation.
Cloud Native Camel Design Patterns6
Cloud Native Platforms
Container Orchestration Wars - by Karl Isenberg http://bit.ly/kube-war
● Docker Swarm (Docker, Inc.)
● ECS (Amazon)
● Kubernetes (Google)
● OpenShift (Red Hat)
● Cloud Foundry (Pivotal/VMware)
● DC/OS (Mesosphere)
● Apache Mesos
● Nomad, Kontena, Rancher...
Scheduling
● Placement/Resurrection
● Replication/Scaling
● Upgrades/Downgrades
Resource Management
● Memory/CPU/GPU
● Volumes/IPs/Ports
Service Management
● Labels/Namespaces
● Load Balancing
● Readiness/Liveness
Cloud Native Camel Design Patterns7
Why Kubernetes?
Portable, extensible, self-healing, platform for automating deployment,
scaling, and operations of containers.
● Technology - based on Google's Borg project
● Community - 1K contributors and 34K commits
● Open Source, Open Standards, part of CNCF
● Backed by large organizations
Cloud Native Camel Design Patterns8
Growing Kubernetes Ecosystem
● Cloud providers: Azure, VMware, Openstack, Rackspace, CenturyLink
● Distros:
● Community - with 1,000-plus contributors and 34,000 commits -- more than
four times those of nearest rival Mesos.
● Open Source, Open Standards, donated to CNCF
●
Cloud Native Camel Design Patterns9
How to run Kubernetes
● Installing from scratch – kubeadm with some manual configuration
● Kops sub project – production grade Kubernetes on AWS
● Kubernetes Anywhere – GCE/AWS/Azure installation
● Google Container Engine – self service Kubernetes clusters
● OpenShift by Red Hat – managed Kubernetes & PAYG options
● 3rd
party service providers - @StackPointCloud, @AppsCodeHQ, @kclusterio
● Local machine – VM, Vagrant, minikube start
● Java devs - mvn fabric8:cluster-start (No Docker, VirtualBox or Vagrant required!)
Cloud Native Camel Design Patterns10
Kubernetes Primitives for Developers
● How to run Kubernetes locally? → Minikube
● How to package apps? → Docker/Rkt
● What is the deployment unit? → Pod
● How to group artifacts? → Labels
● How to isolate resources? → Namespaces
● How to mange configs? → ConfigMap/Secret
● How to get storage? → PersistentVolume
● How to do service discovery & load balancing? → Service & Route
● How to update/rollback services? → Deployment
Cloud Native Camel Design Patterns11
Deployment Patterns
Cloud Native Camel Design Patterns12
Camel Runtime and Packaging
Service only packaging
● Servlet container (Apache Tomcat) – .war
● Application server (WildFly) - .ear
● OSGI container (Karaf) - .fab, .kar, feature.xml, Fuse Fabric profile
Service and Runtime packaging - .zip
● Immutable Karaf distribution – for OSGI fans mainly
● WildFly-Swarm – for JEE shops (through WildFly-Swarm Camel)
● Standalone Java application
● Camel Boot - Spring Boot for Apache Camel
Cloud Native Camel Design Patterns13
Spring Boot and Apache Camel
● Spring Boot integration reimplemented
● Spring Boot Starters
● Spring Boot Auto Configuration
● Spring Boot Health Check - leverage the Spring-Boot actuator module
● A new BOM (Bill of Material) – camel-spring-boot-dependencies
● Unified programing model with Spring annotations and Camel Java DSL
Cloud Native Camel Design Patterns14
Dockerizing Camel Applications
Goal Description
docker:start Create and start containers
docker:stop Stop and destroy containers
docker:build Build images
docker:watch Watch for doing rebuilds and restarts
docker:push Push images to a registry
docker:remove Remove images from local docker host
docker:logs Show container logs
docker:source Attach docker build archive to Maven project
Start Kubernetes: mvn fabric8:cluster-start
Build (artifacts and docker image): mvn clean install docker:build
Deploy a service to Kubernetes: mvn fabric8:json fabric8:apply
Different workflows:
● Centralized platform based build
● Manual scripting with Dockerfile
● Multiple Maven plugins:
➔ Alexec (92*), Wouterd(77*), spotify(735*)
➔ Fabric8 maven docker plugin (472*)
Fabric8 docker-maven-plugin goals
Cloud Native Camel Design Patterns15
Talking to Kubernetes
How to tell Kubernetes to:
● Keep 3 instances of my-service up
● Use the command "/bin/echo", "hello", "world" to start
● Allocate 512MiB memory and one core for it
● Make port 80 accessible
● Set foo environment variable with bar value
● Mount configs with name my-service to location /my-service
● Mount a 5GB R/W persistent volume
● And for updates do rolling update by bringing only 30% of containers down
● And do canary release...
Cloud Native Camel Design Patterns16
Application Descriptor Pattern
Every service requires a manifest/recipe/contract describing its
prerequisites from the platform and runtime model.
mvn fabric8:json fabric8:apply
Cloud Native Camel Design Patterns17
Kubernetes Deployments
Cloud Native Camel Design Patterns18
Health Check Pattern
In order to be a good cloud native citizen, every app should be able to
report its health status.
● Process Health Check – checks for the process to be running
● Application Readiness Health Checking
● Application Liveness Health Checking
➔ HTTP Health Checks – expects return code between 200-399
➔ Container Exec – expects return code 0
➔ TCP Socket – expects to open socket connection
Cloud Native Camel Design Patterns19
Health Check Pattern
Cloud Native Camel Design Patterns20
Lifecycle Hooks
Allows applications to do graceful shutdown and startup.
● To stop a pod, Kubernetes will send SIGTERM 30 seconds before SIGKILL
● PreStop lifecycle hook executed prior to sending SIGTERM.
● PostStart sent immediately after a container is created.
➔ Has the same formats as livenessProbe/readinessProbe and has “at least once” guarantee.
● Termination message - /dev/termination-log
Cloud Native Camel Design Patterns21
Application Configuration Pattern
The bad news: you have externalize everything that is environment specific.
The good news: there is less things to externalize.
Cloud Native Camel Design Patterns22
Service Discovery & Load Balancing
Client side – on the JVM
Cloud Native Camel Design Patterns23
Service Discovery & Load Balancing
Provided by the platform
Cloud Native Camel Design Patterns24
Service Instance
How to accommodate increasing workloads?
Cloud Native Camel Design Patterns25
Service Instance
Areas to consider before horizontally scaling a Camel application.
● Service state: load balancer, circuit breaker, resequencer, sampler, throttler,
idempotent consumer and aggregator are stateful EIPs!
● Request dispatcher: Messaging, HTTP, file consumption (what about locking?)
● Message ordering: exclusive consumer, message groups, consumer priority,
message priority, virtual topics
● Singleton service requirements: for batch jobs, and concurrent polling
● Other resource contention and coupling considerations
Cloud Native Camel Design Patterns26
Singleton Service Pattern
How to ensure that only a single instance of a service is running?
JVM based:
● Karaf
● ActiveMQ
● JBoss HA
Camel based:
● Quartz, ZooKeeper, JGroups
● JBoss Fuse Master Component
● Use the database as a lock
● Exclusive consumers in ActiveMQ
Forget about all of these options, and create a Kubernetes pod with 1 replica.
Cloud Native Camel Design Patterns27
Service Consolidation Pattern
Forget about all these service placement principles...
● Single Service per Host
● Multiple Services per Host
● Shared Application Container(s)
Cloud Native Camel Design Patterns28
Service Consolidation Pattern
...and trust Kubernetes Scheduler
● Policies driven
● Predicates and Priorities
● Topology-aware
● Extensible
● ServiceAffinity Predicate
● ServiceAntiAffinity Priority
Sample topological levels:
region (affinity) → zone (affinity) → rack (anti-affinity)
Cloud Native Camel Design Patterns29
Error Handling Patterns
Cloud Native Camel Design Patterns30
Circuit Breaker Pattern
Improves the stability and the resilience of a system by guarding
integration points from cascading failures and slow responses.
Cloud Native Camel Design Patterns31
Circuit Breaker Pattern
Two Circuit Breaker Implementations in Camel 2.18

Cloud Native Camel Design Patterns32
Retry Pattern
Camel RedeliveryPolicy
● The most well known retry mechanism in Camel
● Retries only the failing endpoint
● Fully in-memory
● Thread blocking behavior by default
● Can be asynchronous
● Good for small number of quick retries (in milliseconds)
Cloud Native Camel Design Patterns33
Idempotent Filter Pattern
How to filter out duplicate messages and ensure only unique messages are
passed through?
Distributed Idempotent Filters:
● Infinispan
● Hazelcast
● Redis
● RDBS
Cloud Native Camel Design Patterns34
Bulkhead Pattern
Enforces resource partitioning and damage containment in order to
preserve partial functionality in the case of a failure.
Cloud Native Camel Design Patterns35
Bulkhead Pattern
● Level 1: Kubernetes scheduler will ensure cross DC spreading of services.
● Level 2: Kubernetes scheduler will ensure cross VM spreading of services.
● Level 3: Use MSA and Bounded Context principles to identify services.
● Level 4: Configure Camel multi-threaded elements, such as: Delayer, Multicast,
Recipient List, Splitter, Threads, Throttler, Wire Tap, Polling Consumer,
ProducerTemplate, and OnCompletion, Circuit Breaker, Async Error Handler.
Cloud Native Camel Design Patterns36
Transactions
Local transactions
Global transactions
Cloud Native Camel Design Patterns37
Saga Pattern
How to avoid distributed transactions and ensure data consistency?
Cloud Native Camel Design Patterns38
Saga Pattern
Ensures that each step of the business process has a compensating action
to undo the work completed in the case of partial failures.
Cloud Native Camel Design Patterns39
New Patterns
Cloud Native Camel Design Patterns40
Batch Jobs on the JVM
Camel batch support :
● Camel timer component – based JDK Timer
● Camel Scheduler component – based on JDK ScheduledExecutorService
● Camel Quartz component – based on Quartz Scheduler 1.x
● Camel Quartz2 component – based on Quartz Scheduler 2.x
● Polling consumers
Limitations:
● Resource consumption – small HA cluster example: 2x VMs, 2x JVMs, with
monitoring, metrics, logs aggregation agents and clustering solution.
● Clustering and HA – 3 ZooKeeper servers, or a shared relational database for state
and locking.
● Fixed topology – cannot move or scale jobs dynamically.
Cloud Native Camel Design Patterns41
Kubernetes Scheduled Job
Features
● Non-parallel Jobs
● Parallel Jobs with a fixed completion
● Parallel Jobs with a work queue
● Concurrency Policy
Prerequisites
● Idempotent jobs
● Meaningful exit code
● Clean Job start
A scheduled job creates one or more pods, once or repeatedly, and ensures
that a specified number of them successfully terminate.
Cloud Native Camel Design Patterns42
Tracing Pattern
Cloud Native Camel Design Patterns43
Canonical Data Model
CDM is daed. Long live Bounded Context
Cloud Native Camel Design Patterns44
How are Integration Patterns Evolving?
Less Relevant
(or provided by the platform)
Not Changed
(still relevant)
More Important
(or a new concern)
Canonical Data Model Load Leveling Bounded Context
Distributed/Global
Transactions
Bulkhead,
Error Channel
Saga,
Compensating Transactions
Batch Job on JVM,
Singleton Service on JVM
Parallel Pipeline
Circuit Breaker,
CQRS
Load Balancing on JVM
Runtime Reconfiguration,
External Configuration
Service Instance,
External Configuration
Service Discovery on JVM VETRO
Tracing,
Health Check
Service Consolidation Data Integrity Policy Driven Scheduling
Reusable Route Monitoring
Retry,
Idempotent Filter
Cloud Native Camel Design Patterns45
5 Takeaways from this Session
✔ Kubernetes is awesome.
✔ Kubernetes is the best place to run Apache Camel applications.
✔ With Kubernetes there are less concerns for developers to worry about.
✔ You need to write even more resilient and scalable services now.
✔ Don't reinvent the wheel, use Fabric8 Cloud Native tooling.
Q & A
@bibryam
Kubernetes http://kubernetes.io/
Fabric8 https://fabric8.io/
Camel Design Patterns http://bit.ly/camel-patterns/
1 von 46

Recomendados

Camel Desing Patterns Learned Through Blood, Sweat, and Tears von
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsBilgin Ibryam
5.5K views34 Folien
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes von
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesRiga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesClaus Ibsen
2.5K views66 Folien
Webcast - Making kubernetes production ready von
Webcast - Making kubernetes production readyWebcast - Making kubernetes production ready
Webcast - Making kubernetes production readyApplatix
1.5K views29 Folien
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019 von
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019confluent
4K views117 Folien
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A... von
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...Henning Jacobs
1.9K views51 Folien
Serverless integration with Knative and Apache Camel on Kubernetes von
Serverless integration with Knative and Apache Camel on KubernetesServerless integration with Knative and Apache Camel on Kubernetes
Serverless integration with Knative and Apache Camel on KubernetesClaus Ibsen
2.6K views44 Folien

Más contenido relacionado

Was ist angesagt?

Build your operator with the right tool von
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right toolRafał Leszko
138 views92 Folien
Kubernetes One-Click Deployment: Hands-on Workshop (Munich) von
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)QAware GmbH
1.4K views93 Folien
Fabric8 - Being devOps doesn't suck anymore von
Fabric8 - Being devOps doesn't suck anymoreFabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymoreHenryk Konsek
2.8K views48 Folien
Commit to excellence - Java in containers von
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containersRed Hat Developers
5K views43 Folien
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18 von
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18CodeOps Technologies LLP
13.1K views27 Folien
Developing with the Go client for Apache Kafka von
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache KafkaJoe Stein
20.9K views27 Folien

Was ist angesagt?(20)

Build your operator with the right tool von Rafał Leszko
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right tool
Rafał Leszko138 views
Kubernetes One-Click Deployment: Hands-on Workshop (Munich) von QAware GmbH
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
QAware GmbH1.4K views
Fabric8 - Being devOps doesn't suck anymore von Henryk Konsek
Fabric8 - Being devOps doesn't suck anymoreFabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymore
Henryk Konsek2.8K views
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18 von CodeOps Technologies LLP
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Developing with the Go client for Apache Kafka von Joe Stein
Developing with the Go client for Apache KafkaDeveloping with the Go client for Apache Kafka
Developing with the Go client for Apache Kafka
Joe Stein20.9K views
Kubernetes extensibility: crd & operators von Giacomo Tirabassi
Kubernetes extensibility: crd & operators Kubernetes extensibility: crd & operators
Kubernetes extensibility: crd & operators
Giacomo Tirabassi105 views
Kubernetes on AWS von Grant Ellis
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWS
Grant Ellis1.1K views
Apache Camel in the belly of the Docker whale von Henryk Konsek
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
Henryk Konsek32.2K views
The Operator Pattern - Managing Stateful Services in Kubernetes von QAware GmbH
The Operator Pattern - Managing Stateful Services in KubernetesThe Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
QAware GmbH622 views
Building Out Your Kafka Developer CDC Ecosystem von confluent
Building Out Your Kafka Developer CDC  EcosystemBuilding Out Your Kafka Developer CDC  Ecosystem
Building Out Your Kafka Developer CDC Ecosystem
confluent373 views
Microservices OSGi-running-with-apache-karaf von Achim Nierbeck
Microservices OSGi-running-with-apache-karafMicroservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karaf
Achim Nierbeck8.9K views
ApacheCon NA - Apache Camel K: a cloud-native integration platform von Nicola Ferraro
ApacheCon NA - Apache Camel K: a cloud-native integration platformApacheCon NA - Apache Camel K: a cloud-native integration platform
ApacheCon NA - Apache Camel K: a cloud-native integration platform
Nicola Ferraro570 views
Kubernetes: The Next Research Platform von Bob Killen
Kubernetes: The Next Research PlatformKubernetes: The Next Research Platform
Kubernetes: The Next Research Platform
Bob Killen1.9K views
KubeCon EU 2016: Multi-Tenant Kubernetes von KubeAcademy
KubeCon EU 2016: Multi-Tenant KubernetesKubeCon EU 2016: Multi-Tenant Kubernetes
KubeCon EU 2016: Multi-Tenant Kubernetes
KubeAcademy4.1K views
Building flexible ETL pipelines with Apache Camel on Quarkus von Ivelin Yanev
Building flexible ETL pipelines with Apache Camel on QuarkusBuilding flexible ETL pipelines with Apache Camel on Quarkus
Building flexible ETL pipelines with Apache Camel on Quarkus
Ivelin Yanev397 views

Destacado

DDD架構設計 von
DDD架構設計DDD架構設計
DDD架構設計國昭 張
3K views95 Folien
Event Storming and Saga von
Event Storming and SagaEvent Storming and Saga
Event Storming and SagaAraf Karsh Hamid
5.8K views58 Folien
CQRS and Event Sourcing von
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event SourcingJan Kronquist
1.6K views28 Folien
Exception handling & logging in Java - Best Practices (Updated) von
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Angelin R
21.1K views35 Folien
Microservices for Enterprises von
Microservices for Enterprises Microservices for Enterprises
Microservices for Enterprises Kasun Indrasiri
28K views35 Folien
Velocity 2017 Performance analysis superpowers with Linux eBPF von
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFBrendan Gregg
736.5K views54 Folien

Destacado(13)

CQRS and Event Sourcing von Jan Kronquist
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
Jan Kronquist1.6K views
Exception handling & logging in Java - Best Practices (Updated) von Angelin R
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)
Angelin R21.1K views
Velocity 2017 Performance analysis superpowers with Linux eBPF von Brendan Gregg
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF
Brendan Gregg736.5K views
Linux Performance Analysis: New Tools and Old Secrets von Brendan Gregg
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg604K views
Linux Systems Performance 2016 von Brendan Gregg
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg504.5K views
Velocity 2015 linux perf tools von Brendan Gregg
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
Brendan Gregg1.1M views
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas von Chris Richardson
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with SagasJavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
JavaOne2017: ACID Is So Yesterday: Maintaining Data Consistency with Sagas
Chris Richardson1.4K views
Kernel Recipes 2017: Using Linux perf at Netflix von Brendan Gregg
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
Brendan Gregg1.5M views
Broken Linux Performance Tools 2016 von Brendan Gregg
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016
Brendan Gregg823.1K views
Container Performance Analysis von Brendan Gregg
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
Brendan Gregg448.6K views

Similar a Cloud Native Camel Design Patterns

Cloud Native Java Development Patterns von
Cloud Native Java Development PatternsCloud Native Java Development Patterns
Cloud Native Java Development PatternsBilgin Ibryam
6.4K views20 Folien
The Kubernetes Effect von
The Kubernetes EffectThe Kubernetes Effect
The Kubernetes EffectBilgin Ibryam
6.1K views33 Folien
OSDC 2018 | Three years running containers with Kubernetes in Production by T... von
OSDC 2018 | Three years running containers with Kubernetes in Production by T...OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...NETWAYS
246 views58 Folien
Breaking the Monolith Road to Containers von
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersAmazon Web Services
1.2K views78 Folien
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware von
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
262 views23 Folien
Hybrid cloud openstack meetup von
Hybrid cloud openstack meetupHybrid cloud openstack meetup
Hybrid cloud openstack meetupdfilppi
507 views36 Folien

Similar a Cloud Native Camel Design Patterns(20)

Cloud Native Java Development Patterns von Bilgin Ibryam
Cloud Native Java Development PatternsCloud Native Java Development Patterns
Cloud Native Java Development Patterns
Bilgin Ibryam6.4K views
OSDC 2018 | Three years running containers with Kubernetes in Production by T... von NETWAYS
OSDC 2018 | Three years running containers with Kubernetes in Production by T...OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
NETWAYS246 views
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware von VMUG IT
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT262 views
Hybrid cloud openstack meetup von dfilppi
Hybrid cloud openstack meetupHybrid cloud openstack meetup
Hybrid cloud openstack meetup
dfilppi507 views
Docker & aPaaS: Enterprise Innovation and Trends for 2015 von WaveMaker, Inc.
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
WaveMaker, Inc.6K views
Ultimate Guide to Microservice Architecture on Kubernetes von kloia
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
kloia722 views
Использование AzureDevOps при разработке микросервисных приложений von Vitebsk Miniq
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
Vitebsk Miniq183 views
Introduction to Kubernetes Workshop von Bob Killen
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen4.7K views
Building a PaaS Platform like Bluemix on OpenStack von Animesh Singh
Building a PaaS Platform like Bluemix on OpenStackBuilding a PaaS Platform like Bluemix on OpenStack
Building a PaaS Platform like Bluemix on OpenStack
Animesh Singh6.3K views
Kubernetes: від знайомства до використання у CI/CD von Stfalcon Meetups
Kubernetes: від знайомства до використання у CI/CDKubernetes: від знайомства до використання у CI/CD
Kubernetes: від знайомства до використання у CI/CD
Stfalcon Meetups522 views
Platform as a Service with Kubernetes and Mesos von Miguel Zuniga
Platform as a Service with Kubernetes and Mesos Platform as a Service with Kubernetes and Mesos
Platform as a Service with Kubernetes and Mesos
Miguel Zuniga3.1K views
9th docker meetup 2016.07.13 von Amrita Prasad
9th docker meetup 2016.07.139th docker meetup 2016.07.13
9th docker meetup 2016.07.13
Amrita Prasad285 views
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless von Bitnami
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Bitnami1.4K views
Edge 2016 Session 1886 Building your own docker container cloud on ibm power... von Yong Feng
Edge 2016 Session 1886  Building your own docker container cloud on ibm power...Edge 2016 Session 1886  Building your own docker container cloud on ibm power...
Edge 2016 Session 1886 Building your own docker container cloud on ibm power...
Yong Feng1K views
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes von Kai Wähner
Confluent Operator as Cloud-Native Kafka Operator for KubernetesConfluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
Kai Wähner6.1K views
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro von Fabio Tiriticco
Reactive Amsterdam - Maxim Burgerhout - Quarkus IntroReactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Fabio Tiriticco955 views
Replace your Docker based Containers with Cri-o Kata Containers for better se... von NETWAYS
Replace your Docker based Containers with Cri-o Kata Containers for better se...Replace your Docker based Containers with Cri-o Kata Containers for better se...
Replace your Docker based Containers with Cri-o Kata Containers for better se...
NETWAYS222 views

Más de Bilgin Ibryam

Dapr - A 10x Developer Framework for Any Language von
Dapr - A 10x Developer Framework for Any LanguageDapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any LanguageBilgin Ibryam
392 views23 Folien
Modernization patterns to refactor a legacy application into event driven mic... von
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Bilgin Ibryam
905 views33 Folien
Application modernization patterns with apache kafka, debezium, and kubernete... von
Application modernization patterns with apache kafka, debezium, and kubernete...Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...Bilgin Ibryam
748 views29 Folien
Dual write strategies for microservices von
Dual write strategies for microservicesDual write strategies for microservices
Dual write strategies for microservicesBilgin Ibryam
4.1K views31 Folien
How to financially survive while growing a small open source project von
How to financially survive while growing a small open source projectHow to financially survive while growing a small open source project
How to financially survive while growing a small open source projectBilgin Ibryam
585 views30 Folien
What next after microservices von
What next after microservicesWhat next after microservices
What next after microservicesBilgin Ibryam
1.2K views54 Folien

Más de Bilgin Ibryam(10)

Dapr - A 10x Developer Framework for Any Language von Bilgin Ibryam
Dapr - A 10x Developer Framework for Any LanguageDapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any Language
Bilgin Ibryam392 views
Modernization patterns to refactor a legacy application into event driven mic... von Bilgin Ibryam
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
Bilgin Ibryam905 views
Application modernization patterns with apache kafka, debezium, and kubernete... von Bilgin Ibryam
Application modernization patterns with apache kafka, debezium, and kubernete...Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
Bilgin Ibryam748 views
Dual write strategies for microservices von Bilgin Ibryam
Dual write strategies for microservicesDual write strategies for microservices
Dual write strategies for microservices
Bilgin Ibryam4.1K views
How to financially survive while growing a small open source project von Bilgin Ibryam
How to financially survive while growing a small open source projectHow to financially survive while growing a small open source project
How to financially survive while growing a small open source project
Bilgin Ibryam585 views
What next after microservices von Bilgin Ibryam
What next after microservicesWhat next after microservices
What next after microservices
Bilgin Ibryam1.2K views
The Evolution of Distributed Systems on Kubernetes von Bilgin Ibryam
The Evolution of Distributed Systems on KubernetesThe Evolution of Distributed Systems on Kubernetes
The Evolution of Distributed Systems on Kubernetes
Bilgin Ibryam2.1K views
Enterprise Integration for Ethereum von Bilgin Ibryam
Enterprise Integration for EthereumEnterprise Integration for Ethereum
Enterprise Integration for Ethereum
Bilgin Ibryam2.8K views
Designing Cloud Native Applications with Kubernetes von Bilgin Ibryam
Designing Cloud Native Applications with KubernetesDesigning Cloud Native Applications with Kubernetes
Designing Cloud Native Applications with Kubernetes
Bilgin Ibryam52.4K views

Último

predicting-m3-devopsconMunich-2023-v2.pptx von
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptxTier1 app
14 views33 Folien
Transport Management System - Shipment & Container Tracking von
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container TrackingFreightoscope
6 views3 Folien
Mobile App Development Company von
Mobile App Development CompanyMobile App Development Company
Mobile App Development CompanyRichestsoft
5 views6 Folien
Chat GPTs von
Chat GPTsChat GPTs
Chat GPTsGene Leybzon
13 views36 Folien
Winter Projects GDSC IITK von
Winter Projects GDSC IITKWinter Projects GDSC IITK
Winter Projects GDSC IITKSahilSingh368445
416 views60 Folien
Using Qt under LGPL-3.0 von
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
14 views11 Folien

Último(20)

predicting-m3-devopsconMunich-2023-v2.pptx von Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app14 views
Transport Management System - Shipment & Container Tracking von Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking
Freightoscope 6 views
Mobile App Development Company von Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 views
Top-5-production-devconMunich-2023-v2.pptx von Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app9 views
Ports-and-Adapters Architecture for Embedded HMI von Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert35 views
predicting-m3-devopsconMunich-2023.pptx von Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app10 views
University of Borås-full talk-2023-12-09.pptx von Mahdi_Fahmideh
University of Borås-full talk-2023-12-09.pptxUniversity of Borås-full talk-2023-12-09.pptx
University of Borås-full talk-2023-12-09.pptx
Mahdi_Fahmideh12 views
How to build dyanmic dashboards and ensure they always work von Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom16 views
Electronic AWB - Electronic Air Waybill von Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 6 views
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... von Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers44 views
Streamlining Your Business Operations with Enterprise Application Integration... von Flexsin
Streamlining Your Business Operations with Enterprise Application Integration...Streamlining Your Business Operations with Enterprise Application Integration...
Streamlining Your Business Operations with Enterprise Application Integration...
Flexsin 5 views
Automated Testing of Microsoft Power BI Reports von RTTS
Automated Testing of Microsoft Power BI ReportsAutomated Testing of Microsoft Power BI Reports
Automated Testing of Microsoft Power BI Reports
RTTS11 views

Cloud Native Camel Design Patterns

  • 1. Cloud Native Camel Design Patterns (Tips for Running Apache Camel on Kubernetes) ApacheCon Europe November 2016 Bilgin Ibryam
  • 2. Cloud Native Camel Design Patterns2 Bilgin Ibryam ● Senior Middleware Architect at Red Hat UK ● Apache Isis Committer and PMC member ● Apache Camel Committer and PMC member ● Apache OFBiz Committer and PMC member ● Author of Camel Design Patterns (new) ● Author of Apache Camel Message Routing ● Twitter: @bibryam ● Email: bibryam@gmail.com ● Blog: http://ofbizian.com ● LinkedIn: http://www.linkedin.com/in/bibryam
  • 3. Cloud Native Camel Design Patterns3 Before Cloud Native
  • 4. Cloud Native Camel Design Patterns4 Trends in the IT Industry ● Application Infrastructure: Data Center, Hosted, Cloud ● Application Deployment: Physical, Virtual, Containers ● Application Architecture: Monolith, N-tier, Microservices ● Development Methodology: Waterfall, Agile, DevOps And these trends do affect the way we design, develop and run Camel applications!
  • 5. Cloud Native Camel Design Patterns5 What is Cloud Native? A cloud-native application is a distributed application that runs on a cloud infrastructure and is in its core scalable and resilient. ● Web-scale – originated from large cloud firms, such as Google, Amazon, Netflix, FB. ● The twelve-factor apps - a methodology for building apps for the Heroku platform. ● 13 factor apps, 14 factor apps – 12 is not enough, nor is 13... ● Cloud-aware or Cloud-ready – cannot benefit from all characteristics of the cloud. ● Cloud native – a marketing term used by Cloud Foundry. ● Cloud Native Computing Foundation - https://cncf.io - part of the Linux Foundation.
  • 6. Cloud Native Camel Design Patterns6 Cloud Native Platforms Container Orchestration Wars - by Karl Isenberg http://bit.ly/kube-war ● Docker Swarm (Docker, Inc.) ● ECS (Amazon) ● Kubernetes (Google) ● OpenShift (Red Hat) ● Cloud Foundry (Pivotal/VMware) ● DC/OS (Mesosphere) ● Apache Mesos ● Nomad, Kontena, Rancher... Scheduling ● Placement/Resurrection ● Replication/Scaling ● Upgrades/Downgrades Resource Management ● Memory/CPU/GPU ● Volumes/IPs/Ports Service Management ● Labels/Namespaces ● Load Balancing ● Readiness/Liveness
  • 7. Cloud Native Camel Design Patterns7 Why Kubernetes? Portable, extensible, self-healing, platform for automating deployment, scaling, and operations of containers. ● Technology - based on Google's Borg project ● Community - 1K contributors and 34K commits ● Open Source, Open Standards, part of CNCF ● Backed by large organizations
  • 8. Cloud Native Camel Design Patterns8 Growing Kubernetes Ecosystem ● Cloud providers: Azure, VMware, Openstack, Rackspace, CenturyLink ● Distros: ● Community - with 1,000-plus contributors and 34,000 commits -- more than four times those of nearest rival Mesos. ● Open Source, Open Standards, donated to CNCF ●
  • 9. Cloud Native Camel Design Patterns9 How to run Kubernetes ● Installing from scratch – kubeadm with some manual configuration ● Kops sub project – production grade Kubernetes on AWS ● Kubernetes Anywhere – GCE/AWS/Azure installation ● Google Container Engine – self service Kubernetes clusters ● OpenShift by Red Hat – managed Kubernetes & PAYG options ● 3rd party service providers - @StackPointCloud, @AppsCodeHQ, @kclusterio ● Local machine – VM, Vagrant, minikube start ● Java devs - mvn fabric8:cluster-start (No Docker, VirtualBox or Vagrant required!)
  • 10. Cloud Native Camel Design Patterns10 Kubernetes Primitives for Developers ● How to run Kubernetes locally? → Minikube ● How to package apps? → Docker/Rkt ● What is the deployment unit? → Pod ● How to group artifacts? → Labels ● How to isolate resources? → Namespaces ● How to mange configs? → ConfigMap/Secret ● How to get storage? → PersistentVolume ● How to do service discovery & load balancing? → Service & Route ● How to update/rollback services? → Deployment
  • 11. Cloud Native Camel Design Patterns11 Deployment Patterns
  • 12. Cloud Native Camel Design Patterns12 Camel Runtime and Packaging Service only packaging ● Servlet container (Apache Tomcat) – .war ● Application server (WildFly) - .ear ● OSGI container (Karaf) - .fab, .kar, feature.xml, Fuse Fabric profile Service and Runtime packaging - .zip ● Immutable Karaf distribution – for OSGI fans mainly ● WildFly-Swarm – for JEE shops (through WildFly-Swarm Camel) ● Standalone Java application ● Camel Boot - Spring Boot for Apache Camel
  • 13. Cloud Native Camel Design Patterns13 Spring Boot and Apache Camel ● Spring Boot integration reimplemented ● Spring Boot Starters ● Spring Boot Auto Configuration ● Spring Boot Health Check - leverage the Spring-Boot actuator module ● A new BOM (Bill of Material) – camel-spring-boot-dependencies ● Unified programing model with Spring annotations and Camel Java DSL
  • 14. Cloud Native Camel Design Patterns14 Dockerizing Camel Applications Goal Description docker:start Create and start containers docker:stop Stop and destroy containers docker:build Build images docker:watch Watch for doing rebuilds and restarts docker:push Push images to a registry docker:remove Remove images from local docker host docker:logs Show container logs docker:source Attach docker build archive to Maven project Start Kubernetes: mvn fabric8:cluster-start Build (artifacts and docker image): mvn clean install docker:build Deploy a service to Kubernetes: mvn fabric8:json fabric8:apply Different workflows: ● Centralized platform based build ● Manual scripting with Dockerfile ● Multiple Maven plugins: ➔ Alexec (92*), Wouterd(77*), spotify(735*) ➔ Fabric8 maven docker plugin (472*) Fabric8 docker-maven-plugin goals
  • 15. Cloud Native Camel Design Patterns15 Talking to Kubernetes How to tell Kubernetes to: ● Keep 3 instances of my-service up ● Use the command "/bin/echo", "hello", "world" to start ● Allocate 512MiB memory and one core for it ● Make port 80 accessible ● Set foo environment variable with bar value ● Mount configs with name my-service to location /my-service ● Mount a 5GB R/W persistent volume ● And for updates do rolling update by bringing only 30% of containers down ● And do canary release...
  • 16. Cloud Native Camel Design Patterns16 Application Descriptor Pattern Every service requires a manifest/recipe/contract describing its prerequisites from the platform and runtime model. mvn fabric8:json fabric8:apply
  • 17. Cloud Native Camel Design Patterns17 Kubernetes Deployments
  • 18. Cloud Native Camel Design Patterns18 Health Check Pattern In order to be a good cloud native citizen, every app should be able to report its health status. ● Process Health Check – checks for the process to be running ● Application Readiness Health Checking ● Application Liveness Health Checking ➔ HTTP Health Checks – expects return code between 200-399 ➔ Container Exec – expects return code 0 ➔ TCP Socket – expects to open socket connection
  • 19. Cloud Native Camel Design Patterns19 Health Check Pattern
  • 20. Cloud Native Camel Design Patterns20 Lifecycle Hooks Allows applications to do graceful shutdown and startup. ● To stop a pod, Kubernetes will send SIGTERM 30 seconds before SIGKILL ● PreStop lifecycle hook executed prior to sending SIGTERM. ● PostStart sent immediately after a container is created. ➔ Has the same formats as livenessProbe/readinessProbe and has “at least once” guarantee. ● Termination message - /dev/termination-log
  • 21. Cloud Native Camel Design Patterns21 Application Configuration Pattern The bad news: you have externalize everything that is environment specific. The good news: there is less things to externalize.
  • 22. Cloud Native Camel Design Patterns22 Service Discovery & Load Balancing Client side – on the JVM
  • 23. Cloud Native Camel Design Patterns23 Service Discovery & Load Balancing Provided by the platform
  • 24. Cloud Native Camel Design Patterns24 Service Instance How to accommodate increasing workloads?
  • 25. Cloud Native Camel Design Patterns25 Service Instance Areas to consider before horizontally scaling a Camel application. ● Service state: load balancer, circuit breaker, resequencer, sampler, throttler, idempotent consumer and aggregator are stateful EIPs! ● Request dispatcher: Messaging, HTTP, file consumption (what about locking?) ● Message ordering: exclusive consumer, message groups, consumer priority, message priority, virtual topics ● Singleton service requirements: for batch jobs, and concurrent polling ● Other resource contention and coupling considerations
  • 26. Cloud Native Camel Design Patterns26 Singleton Service Pattern How to ensure that only a single instance of a service is running? JVM based: ● Karaf ● ActiveMQ ● JBoss HA Camel based: ● Quartz, ZooKeeper, JGroups ● JBoss Fuse Master Component ● Use the database as a lock ● Exclusive consumers in ActiveMQ Forget about all of these options, and create a Kubernetes pod with 1 replica.
  • 27. Cloud Native Camel Design Patterns27 Service Consolidation Pattern Forget about all these service placement principles... ● Single Service per Host ● Multiple Services per Host ● Shared Application Container(s)
  • 28. Cloud Native Camel Design Patterns28 Service Consolidation Pattern ...and trust Kubernetes Scheduler ● Policies driven ● Predicates and Priorities ● Topology-aware ● Extensible ● ServiceAffinity Predicate ● ServiceAntiAffinity Priority Sample topological levels: region (affinity) → zone (affinity) → rack (anti-affinity)
  • 29. Cloud Native Camel Design Patterns29 Error Handling Patterns
  • 30. Cloud Native Camel Design Patterns30 Circuit Breaker Pattern Improves the stability and the resilience of a system by guarding integration points from cascading failures and slow responses.
  • 31. Cloud Native Camel Design Patterns31 Circuit Breaker Pattern Two Circuit Breaker Implementations in Camel 2.18

  • 32. Cloud Native Camel Design Patterns32 Retry Pattern Camel RedeliveryPolicy ● The most well known retry mechanism in Camel ● Retries only the failing endpoint ● Fully in-memory ● Thread blocking behavior by default ● Can be asynchronous ● Good for small number of quick retries (in milliseconds)
  • 33. Cloud Native Camel Design Patterns33 Idempotent Filter Pattern How to filter out duplicate messages and ensure only unique messages are passed through? Distributed Idempotent Filters: ● Infinispan ● Hazelcast ● Redis ● RDBS
  • 34. Cloud Native Camel Design Patterns34 Bulkhead Pattern Enforces resource partitioning and damage containment in order to preserve partial functionality in the case of a failure.
  • 35. Cloud Native Camel Design Patterns35 Bulkhead Pattern ● Level 1: Kubernetes scheduler will ensure cross DC spreading of services. ● Level 2: Kubernetes scheduler will ensure cross VM spreading of services. ● Level 3: Use MSA and Bounded Context principles to identify services. ● Level 4: Configure Camel multi-threaded elements, such as: Delayer, Multicast, Recipient List, Splitter, Threads, Throttler, Wire Tap, Polling Consumer, ProducerTemplate, and OnCompletion, Circuit Breaker, Async Error Handler.
  • 36. Cloud Native Camel Design Patterns36 Transactions Local transactions Global transactions
  • 37. Cloud Native Camel Design Patterns37 Saga Pattern How to avoid distributed transactions and ensure data consistency?
  • 38. Cloud Native Camel Design Patterns38 Saga Pattern Ensures that each step of the business process has a compensating action to undo the work completed in the case of partial failures.
  • 39. Cloud Native Camel Design Patterns39 New Patterns
  • 40. Cloud Native Camel Design Patterns40 Batch Jobs on the JVM Camel batch support : ● Camel timer component – based JDK Timer ● Camel Scheduler component – based on JDK ScheduledExecutorService ● Camel Quartz component – based on Quartz Scheduler 1.x ● Camel Quartz2 component – based on Quartz Scheduler 2.x ● Polling consumers Limitations: ● Resource consumption – small HA cluster example: 2x VMs, 2x JVMs, with monitoring, metrics, logs aggregation agents and clustering solution. ● Clustering and HA – 3 ZooKeeper servers, or a shared relational database for state and locking. ● Fixed topology – cannot move or scale jobs dynamically.
  • 41. Cloud Native Camel Design Patterns41 Kubernetes Scheduled Job Features ● Non-parallel Jobs ● Parallel Jobs with a fixed completion ● Parallel Jobs with a work queue ● Concurrency Policy Prerequisites ● Idempotent jobs ● Meaningful exit code ● Clean Job start A scheduled job creates one or more pods, once or repeatedly, and ensures that a specified number of them successfully terminate.
  • 42. Cloud Native Camel Design Patterns42 Tracing Pattern
  • 43. Cloud Native Camel Design Patterns43 Canonical Data Model CDM is daed. Long live Bounded Context
  • 44. Cloud Native Camel Design Patterns44 How are Integration Patterns Evolving? Less Relevant (or provided by the platform) Not Changed (still relevant) More Important (or a new concern) Canonical Data Model Load Leveling Bounded Context Distributed/Global Transactions Bulkhead, Error Channel Saga, Compensating Transactions Batch Job on JVM, Singleton Service on JVM Parallel Pipeline Circuit Breaker, CQRS Load Balancing on JVM Runtime Reconfiguration, External Configuration Service Instance, External Configuration Service Discovery on JVM VETRO Tracing, Health Check Service Consolidation Data Integrity Policy Driven Scheduling Reusable Route Monitoring Retry, Idempotent Filter
  • 45. Cloud Native Camel Design Patterns45 5 Takeaways from this Session ✔ Kubernetes is awesome. ✔ Kubernetes is the best place to run Apache Camel applications. ✔ With Kubernetes there are less concerns for developers to worry about. ✔ You need to write even more resilient and scalable services now. ✔ Don't reinvent the wheel, use Fabric8 Cloud Native tooling.
  • 46. Q & A @bibryam Kubernetes http://kubernetes.io/ Fabric8 https://fabric8.io/ Camel Design Patterns http://bit.ly/camel-patterns/