Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Integrating microservices with apache camel on kubernetes

430 Aufrufe

Veröffentlicht am

Apache Camel has fundamentally changed the way Java developers build system-to-system integrations by using enterprise integration patterns (EIP) with modern microservice architectures. In this session, we’ll show you best practices with Camel and EIPs, in the world of Spring Boot microservices running on Kubernetes. We'll also discuss practices how to build truly cloud-native distributed and fault-tolerant microservices and we’ll introduce the upcoming Camel 3.0 release, which includes serverless capabilities via Camel K. This talk is a mix with slides and live demos.

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

Integrating microservices with apache camel on kubernetes

  1. 1. Integrating microservices with Apache Camel on Kubernetes Claus Ibsen, Andrea Cosentino & Nicola Ferraro
  2. 2. Meet the speakers
  3. 3. About Claus Ibsen ● Senior Principal Software Engineer at Red Hat ● Java Champion ● 11 years as full time Apache Camel committer ● Author of Camel in Action books ● Based in Denmark Blog: http://www.davsclaus.com Twitter: @davsclaus Linkedin: davsclaus
  4. 4. About Andrea Cosentino ● Senior Software Engineer at Red Hat ● Apache Camel PMC Chair ● Based in Italy Blog: https://oscerd.github.io/ Twitter: @oscerd2
  5. 5. About Nicola Ferraro ● Senior Software Engineer at Red Hat ● Apache Camel PMC Member ● Working on Camel K ● Based in Italy Blog: http://www.nicolaferraro.me Twitter: @ni_ferraro
  6. 6. System Integration
  7. 7. Integration Framework
  8. 8. Enterprise Integration Patterns
  9. 9. Enterprise Integration Patterns
  10. 10. Camel Routes from("file:data/inbox") .to("jms:queue:order"); <route> <from ri="file:data/inbox"/> <to uri="jms:queue:order"/> </route> Java DSL XML DSL
  11. 11. Camel Routes with Splitter
  12. 12. Camel Routes with Splitter from("file:inbox")
  13. 13. Camel Routes with Splitter from("file:inbox") .split(body().tokenize("n"))
  14. 14. Camel Routes with Splitter from("file:inbox") .split(body().tokenize("n")) .marshal(customToXml) Custom data transformation
  15. 15. Camel Routes with Splitter from("file:inbox") .split(body().tokenize("n")) .marshal(customToXml) .to("activemq:line"); Custom data transformation
  16. 16. Camel Architecture
  17. 17. Camel runs everywhere Application Servers Linux Containers
  18. 18. Camel connects everything Enterprise Systems ● File ● FTP ● JMS ● AMQP ● JDBC ● SQL ● TCP/UDP ● Mail ● HDFS ● JPA ● MongoDB ● Kafka ● ... Public Cloud ● AWS ○ S3 ○ SQS ○ Kinesis ○ ... ● Google ○ BigQuery ○ PubSub ● Azure ○ Blob ○ Queue ● Box ● Dropbox ● Facebook ● Linkedin ● Salesforce ● SAP ● ServiceNowIoT ● CoAP ● MQTT ● PubNub SaaS
  19. 19. +
  20. 20. + +
  21. 21. + + +
  22. 22. + + + =
  23. 23. What about Camel in the Cloud?
  24. 24. Monolith MyApp Slides by @burrsutter
  25. 25. Microservices
  26. 26. Microservices
  27. 27. Microservices
  28. 28. Microservices
  29. 29. Microservices
  30. 30. Microservices
  31. 31. Network of Services
  32. 32. Container JVM Service C Microservices == Distributed Computing Container JVM Service B Container JVM Service A
  33. 33. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Microservices'ilities
  34. 34. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Microservices'ilities + Kubernetes
  35. 35. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Microservices'ilities + PaaS
  36. 36. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Microservices'ilities + Istio
  37. 37. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Microservices'ilities + API management
  38. 38. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity But where is Camel?
  39. 39. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity But where is Camel? embedded in your (Java) services
  40. 40. Container JVM Service C Microservices == Distributed Integration Container JVM Service B Container JVM Service A
  41. 41. Container JVM Service C Microservices == Distributed Integration Container JVM Service B Container JVM Service A External Systems
  42. 42. Camel in the Cloud
  43. 43. Best Practice - Small in Size ● Camel is light-weight ○ (camel-core 4mb) ○ + what you need ● Single fat-jar via:
  44. 44. Best Practice - Stateless ● Favour stateless applications ● If state is needed: ○ Data-grid ■ camel-infinispan ■ camel-hazelcast ■ camel-ignite ■ ... ○ Storage ■ camel-sql ■ camel-jpa ■ camel-kafka ■ ... ○ Kubernetes ■ Stateful-set
  45. 45. ● Kubernetes ConfigMap ○ Inject via ENV ○ Inject via files ● Kubernetes Secrets ○ Inject via ENV ○ Inject via files Best Practice - Configuration Management $ kubectl get cm -o yaml my-configmap apiVersion: v1 data: fallback: I still got no response kind: ConfigMap
  46. 46. Best Practice - Fault Tolerant ● Camel Retry ○ onException ○ errorHandler ● Camel Hystrix ○ circuit breaker
  47. 47. Best Practice - Fault Tolerant ● Camel Retry ○ onException ○ errorHandler
  48. 48. Best Practice - Fault Tolerant ● Camel Retry ○ onException ○ errorHandler Thundering Herd Problem
  49. 49. Best Practice - Health Checks ● Health Checks ○ camel-spring-boot actuator ● Readiness Probe ○ Kubernetes ● Liveness Probe ○ Kubernetes
  50. 50. ● Works anywhere Best Practice - EIP Patterns
  51. 51. EIP Cloud Patterns Hystrix EIP from("timer:foo") .hystrix() .to("http:myservice") .onFallback() .to("bean:myfallback") .end()
  52. 52. EIP Cloud Patterns rest().post("train/buy/seat") .saga() .compensation("direct:cancel") ... .to("http:trainservice/buy") Saga EIP
  53. 53. EIP Cloud Patterns Distributed Tracing
  54. 54. MyService Monitoring Tracing API Discovery Invocation Resilience Pipeline Authentication Logging Elasticity Usable Camel capabilities Camel Retry Camel Hystrix Camel Zipkin Camel OpenTracing Camel Rest Camel Components
  55. 55. Apache Camel 3 3
  56. 56. Apache Camel Community ● Apache Camel has 466 contributors (from Github) ● ~2500 stars on Github ● ~3300 forks on Github ● >1000 subscribers on users mailing list ● 8600 questions on StackOverFlow ● 2 new committers in the last months and one new PMC member ● And keep growing...
  57. 57. Camel 3.0 - What to expect ● Overall goals: ○ Backwards compatible (as much as possible) ○ Light-weight & modular camel-core ○ Tidy up APIs & cleanup of technical debt ○ Fluent Builder Endpoint configuration (Java & XML) ○ New Cloud EIP Patterns ○ Quarkus extensions ○ Java 11 support ○ Timeboxed release ○ New website/documentation ○ Camel-K (we’ll see this later)
  58. 58. Generate Fluent Builders for configuring Endpoints elay=”2000”/> ● Generator for both Java DSL and XML DSL (namespace) ● So you can do something like: from(file(“inbox”).recursive().withDelay(2000)...) .to(jms(“cheese”).withTimeToLive(5000)...); <from> <file directory=”inbox” recursive=”true” delay=”2000”/> </from> <to> <jms queue=”cheese” timeToLive=”5000”/> </to>
  59. 59. New website & Documentation elay=”2000”/> ● Currently migrating existing wiki docs to ascii docs (more than 80% has been done) ● Tool to generate website and documentation ● Planned for launch for Camel 3 final release ● We already have something new in staging: ○ https://camel.apache.org/staging/
  60. 60. Quarkus elay=”2000”/> ● Compile to GraalVM native binaries ● Just some components will be supported in native mode ● We’ll probably have a git repo containing extension ● Quarkus already contains a set of extensions: ○ Camel-core ○ Camel-salesforce ○ Camel-netty4-http ○ Camel-aws-s3
  61. 61. Next steps elay=”2000”/> ● Final Camel 3 release will (probably) be in September 2019 ● Milestone 2 Release will be in April 2019 ● Milestone 1 is already out from February and feedback are welcome ● Don’t be ashamed: ○ https://gitter.im/apache/apache-camel ○ https://issues.apache.org/jira/browse/CAMEL ○ users@camel.apache.org, dev@camel.apache.org
  62. 62. Contributing elay=”2000”/> ● This is probably the best period to start contributing to Apache Camel ○ https://github.com/apache/camel/blob/master/CONTRIBUTING.md ● New features ● New components ● New website ● Anyone who aims to contribute can find stuff to work on. ● Because WE LOVE CONTRIBUTIONS!
  63. 63. Google Summer of Code 2019 elay=”2000”/> ● Apache Camel participates to GSoC this year under the ASF organization ● We have a lot of issues to work on, labeled for this event ● Just search for the gsoc2019 label in the Camel JIRA https://issues.apache.org/jira/browse/CAMEL ● Camel PMC members will be mentors
  64. 64. Apache Camel K K
  65. 65. Camel K A lightweight platform for running Camel integration DSL in the cloud. ● Based on operator-sdk ● Works on Openshift and “vanilla” Kubernetes $ kamel run routes.groovy --dev from(“telegram:bots/bot-id”) .transform()... .to(“kafka:topic”); from(“kafka:topic”) .to(“http:my-host/api/path”); File routes.groovy
  66. 66. Camel K Now part of Knative. Camel K is Serverless: ● Autoscaling and scaling to zero (Knative Serving) ● Event-based communication (Knative eventing) ● CamelSources in Knative: https://github.com/knative/eventing- sources/tree/master/contrib/camel/samples +
  67. 67. Camel K Demo Let’s build a Telegram Chat Bot in few minutes. You’ll need shortly on your phone: - Telegram App - A QR Code reader
  68. 68. Camel K Demo Let’s build a Telegram Chat Bot in few minutes. @camelkbot
  69. 69. More Information ● Apache Camel: http://camel.apache.org ● Apache Camel K https://github.com/apache/camel-k ● Demo Code https://github.com/nicolaferraro/camel-k-chuck-bot
  70. 70. Q & A

×