Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

Camel on Cloud by Christina Lin

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité

Consultez-les par la suite

1 sur 65 Publicité

Camel on Cloud by Christina Lin

Télécharger pour lire hors ligne

The slide deck used in the Apache Camel / Syndesis Seminar at Red Hat, K.K., Ebisu --
https://jcug-oss.connpass.com/event/99168/

Uploaded with permission of Christina Lin

The slide deck used in the Apache Camel / Syndesis Seminar at Red Hat, K.K., Ebisu --
https://jcug-oss.connpass.com/event/99168/

Uploaded with permission of Christina Lin

Publicité
Publicité

Plus De Contenu Connexe

Diaporamas pour vous (20)

Similaire à Camel on Cloud by Christina Lin (20)

Publicité

Plus par Tadayoshi Sato (11)

Plus récents (20)

Publicité

Camel on Cloud by Christina Lin

  1. 1. GENERAL DISTRIBUTION Camel On Cloud Christina Lin RH Technology Evangelist
  2. 2. RED HAT CONSULTING2 TIME TABLE 18:30-19:15 CAMEL ON CLOUD 19:15 - 19: 30 BREAK 19:30 - 20: 00 SYNDESIS INTRO 20:00 - 20:30 IDEA BRAINSTORMING ONE Minute Each 20:30-21:00 IDEA JUDGE
  3. 3. Development Process Waterfall CI/CD Deployment Server/VM Container Infrastructure Data Center Cloud Architecture Monolith MicroservicesAPIs Webservices Service Endpoints BE COMPETITIVE Enterprise IT is undergoing fundamental change. To remain competitive, businesses need an integration platform capable of supporting current and next generation architectures.
  4. 4. Integration
  5. 5. Integration
  6. 6. 6 THREE PILLARS OF AGILE INTEGRATION Key foundational capabilities needed by today’s enterprises DISTRIBUTED INTEGRATION ❏ Lightweight ❏ Pattern Based ❏ Event Oriented ❏ Community Sourced MICROSERVICES CONTAINERS ❏ Cloud Native Solutions ❏ Lean Artifacts ❏ Individually Deployable ❏ Container Based Scaling and High Availability APIs ❏ Well Defned ❏ Reusable ❏ Well Managed End-points ❏ Ecosystem Leverage FLEXIBILITY SCALABILITY RE-USABILITY
  7. 7. AGILE INTEGRATION ARCHITECTURE Core Layer External Applications Network Gateway Layer Containers ContainerOrchestration(OpenShift) 7 Composite Layer Service Interactions Cloud Native App (Runtime 1) Enterprise Integration Patterns Business Rules Anti Corruption Layer Containerized App (Lift and Shift EAP) SecurityServices(RHSSO) DataServices(DataGrid) Traditional App (EAP) VMs APIManagement(3scale) Policies Access Control Proxy Routing Service Composition Events Mesh DevOps Automation / Continuous Integration / Continuous Delivery (Ansible)
  8. 8. CONTAINERIZED. CLOUD DEPLOYMENT. CAMEL IN A NUTSHELL CHOOSE RUNTIME DEFINE INTEGRATION LOGIC FROM ? TO ? ROUTE ? TRANSFORM ? API ? ● Leverage Agile Integration to build new services ● And to integrate with existing services and data ● Integration can be a key platform for all app dev projects ● As well as migrations from existing ESB vendors Connect - Mediate - Transform: Data, Services and Information
  9. 9. INSERT DESIGNATOR, IF NEEDED9 WHAT IS APACHE CAMEL? Split orders Send each order to it’s process service Electronics Others Customer Purchase from("fle:work/cbr/input") .split(xpath("//orders")) .choice() .when(xpath("/order:order/order:type = 'E'")) .to("activemq:queue:electronic/us") .otherwise() .recipientList(simple("http4://otherservice"));
  10. 10. INSERT DESIGNATOR, IF NEEDED10 PATTERN BASED Split orders Send each order to it’s process service Electronics Others Aggregat or Normaliz er Content Enricher Resequencer
  11. 11. INSERT DESIGNATOR, IF NEEDED11 160+ ENDPOINT COMPONENTS activemq cxf kubernetes jasypt activemq-journal cxfrs freemarker javaspace amqp dataset ftp/ftps/sftp jbi atom db4o gae jcr bean direct hdfs jdbc bean validation ejb hibernate jetty browse esper hl7 jms cache event http jmx cometd exec ibatis jpa crypto fle irc jt/400
  12. 12. INSERT DESIGNATOR, IF NEEDED12 160+ ENDPOINT COMPONENTS Kafka propertee eeda stream ldap quartz eervlet etring-template mail/imap/pop3 quickfi eip teet mina ref emooke tmer mock reetlet empp validaton mev rmi enmp velocity nagioe rnc epring-integraton vm nety rng epring-eecurity impp nmr ree epring-we iquery printer ecalate eql xslt
  13. 13. REST DSL <camelContext xmlns="http://camel.apache.org/schema/spring"> <rest path="/say"> <get uri="/hello"> <to uri="direct:hello"/> </get> <get uri="/bye" consumes="application/json"> <to uri="direct:bye"/> </get> <post uri="/bye"> <to uri="mock:update"/> </post> </rest> <route> <from uri="direct:hello"/> … </route> <route> <from uri="direct:bye"> … </route> </camelContext> Verb defining http method Basepath The service path Uri template The service method and parameters Consumes Accept data format setting
  14. 14. CAMEL ON DIET
  15. 15. RUNNING CAMEL Spring Boot Apache Karaf (OSGi) Spring DSL/Java Spring Boot Starter module Fat JARs Stand-alone App Embedded dependency Pre-confgured, pre- sugared Small and lightweight Blueprint DSL/Java Blueprint module Bundles Modularized Explicit dependency Versioned Hot redeploy
  16. 16. ● Granularity ● Security Microservice Composition
  17. 17. DISTRIBUTED INTEGRATION Container Container Container Container Container Container Container DISCOVER SERVICES XA TRANSACTION TRANSACTION RECOVERY API TRANSACTION (SAGA) METRICS LOGS
  18. 18. XA TRANSACTION Container <dependency> <groupId>me.snowdrop</groupId> <artifactId>narayana-spring-boot-starter</artifactId> </dependency> <dependency> <groupId>me.snowdrop</groupId> <artifactId>narayana-spring-boot-recovery-controller</artifactId> </dependency> Or <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jta-narayana</artifactId> </dependency> PersistentVolumeClaim StatefulSet CLUSTER RECOVERY DATA app-0 Container - name: CLUSTER_RECOVERY_ENABLED value: true - name: CLUSTER_NODENAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name image: 'rhte-creditcard:latest' - mountPath: /var/transaction/data name: @project.artifactId@-data - name: CLUSTER_BASE_DIR value: /var/transaction/data # Cluster (options replaced by Openshift env variables) cluster.name=@project.artifactId@ cluster.nodename=${cluster.name}-0 cluster.base-dir=./target/tx # Recovery is enabled only inside Openshift cluster.recovery.enabled=false # Transaction data spring.jta.transaction-manager-id=${cluster.nodename} spring.jta.log-dir=${cluster.base-dir}/store/${cluster.nodename} # Transaction recovery settings snowdrop.narayana.openshift.recovery.enabled=${cluster.recovery.enabled} snowdrop.narayana.openshift.recovery.current-pod-name=${cluster.nodename} snowdrop.narayana.openshift.recovery.statefulset=${cluster.name} snowdrop.narayana.openshift.recovery.status-dir=${cluster.base-dir}/status leader app-1 Container app-2 Container
  19. 19. SAGA PATTERN Service One Service Two Service Three Service Four compensation compensation compensationcompensation
  20. 20. SAGA PATTERN Booking Payment Hotel Flight LRA camel: service: lra: enabled: true coordinator-url: http://lra-coordinator.rhte.svc:46000 local-participant-url: http://${project.artifactId}:8080/api .saga() .propagation(SagaPropagation.MANDATORY) .compensation("direct:cancelBooking") .to("sql:INSERT INTO FLIGHT (custid, traveldatestart, traveldateend ) VALUES (:#id, :#traveldatestart, :#traveldateend)?dataSource=dataSource") .toD("http4://rhte-creditcard.rhte.svc:8080/credircard/pay/${header.id}/${header.payamt}?bridgeEndpoint=true") .saga() .setHeader(Exchange.HTTP_METHOD, constant("POST")) .toD("http4://rhte-flight.rhte.svc:8080/api/book?bridgeEndpoint=true") .toD("http4://rhte-hotel.rhte.svc:8080/api/book?bridgeEndpoint=true") compensation compensation
  21. 21. FROM GROUND TO CLOUD
  22. 22. source-to-image (s2i) deployments Build POD GIT repository Developer pull code push image
  23. 23. FABRIC8 PLUGIN Developer push image Build POD <plugin> <groupId>io.fabric8</groupId> <artifactId>fabric8-maven-plugin</artifactId> <version>${fabric8-maven-plugin.version}</version> <executions> <execution> <goals> <goal>resource</goal> <goal>build</goal> </goals> </execution> </executions> </plugin> mvn fabric8:deploy
  24. 24. CONFIGURATION INJECTION Mounted Volume <dependency> <groupId>io.fabric8</groupId> <artifactId>spring-cloud-kubernetes-core</artifactId> <version>0.1.6</version> </dependency> POD POD Confgmap Application Application.properties Application Application.properties
  25. 25. OPENSHIFT PIPELINE OpenShift Jekins Image Repositor y Git Pods Build Deplo y Webhoo k Git push Pipeline starts Build application image Running application container in diferent environment
  26. 26. OPENSHIFT PIPELINE node('maven') { stage('build') { openshiftBuild(buildConfg: 'buildconfgname', showBuildLogs: 'true') } stage('staging') { openshiftDeploy(deploymentConfg: 'deploymentconfgame') } …. }
  27. 27. THANK YOU plus.google.com/+RedHat linkedin.com/company/red-hat youtube.com/user/RedHatVide os facebook.com/redhatinc twitter.com/RedHatNews 27
  28. 28. IS MY ORGANIZATION DOING INTEGRATION? POINT-TO-POINT (P2P) SERVICE BUS BUSINESS-TO-BUSINESS DIY INTEGRATION LEGACY INTEGRATION MICROSERVICES API-FOCUSED AUTOMATION CLOUD-NATIVE SELF-SERVICE
  29. 29. 29 TWO DIMENSIONS OF DISTRIBUTED INTEGRATION DISTRIBUTED INTEGRATION FLEXIBILITY WHERE INTEGRATION IS USED Integration at the center or the edge of your enterprise architecture. WHO PERFORMS INTEGRATION Unlocking integration capability for new categories of integrators.
  30. 30. Fuse Standalone Fuse on OpenShift Fuse Online (iPaaS) ● Developer-focused ● Integration where you need it ● “Classic” integration THE NEXT GENERATION OF RED HAT FUSE Aligned product components of Fuse 7.x ● Developer-focused ● Microservices ready ● Scale out / Container ● “Cloud native” integration ● Ignite : Low-code UI/UX ● 100% cloud-based ● Integration through a browser ● “Ad Hoc” Integration
  31. 31. OS JVM Narayana Undertow AMQ CXF Camel Karaf OS JVM Narayana Undertow AMQ CXF Camel EAP OS JVM Narayana Undertow AMQ CXF Camel Spring BootIgnite Fuse Online RED HAT FUSE Hawtio Distributed, Cloud-native integration platform
  32. 32. INSERT DESIGNATOR, IF NEEDED32 Self-service Integration Low code integration platform for everyone Fuse Online Integration Connectors Customizations Self-service Drag and drop integrations Runtime debug and activity trace Built-in connectors - AMQ - Database - Salesforce and more... Customize Connectors - Highly customizable connectors from developers API Client Service Setup from Swagger Documents Customize Connectors, code, component injections
  33. 33. Ease of Use Drag and drop, plus simple confgurations Design Confg Run Design your integration quickly on the fy for continuously Innovative solutions. Less.development time, quick POC and faster blueprint???!! Built-in connectors for major resources. Easy drag and drop data format mapping. Simple confguration interface Hybrid environment, on the cloud or on premise. United and standardized platform for integration solutions. Enhance collaboration experience for both business user and Developers
  34. 34. Working with APIs API centric integration. API Services Providers Fuse Online Swagger Documents
  35. 35. Cloud Native Integration
  36. 36. 36 KEY SUCCESS FACTORS FOR CLOUD-NATIVE INTEGRATION DEVELOPMENT Ability to drive complete lifecycle from developer toolchain Focus on code, not image building and resource defnition End-to-end automation supporting continuous delivery MANAGEMENT Centralized management and monitoring Manual and automated management through API, CLI, UI Domain-specifc introspection into container runtime SECURITY Images require secure stack from top to bottom Scaling analysis and remediation of security vulnerabilities Container image provenance and transparency OPERATIONS Normalizing operations across workloads Availability, scalability, and resiliency Leveraging advanced deployment options Enabled by using Fuse on OpenShift
  37. 37. Tools for success Development ● Full lifecycle IDE support ● Built-in Connector/Transformat ion/EIP ● Intuitive API creation ● Easy-to-use Toolings ● Quickstart templates ● Built-in CI/CD capability ● Immutable software image builds ● Lightweight, optimized for microservices
  38. 38. CORE FUSE FUSE STANDALONE OS JVM EAP Spring Boot Karaf Narayana Undertow AMQ CXF Camel DevStudio Hawtio
  39. 39. NOTABLE COMPONENTS ● Camel 2.21 ● Karaf 4.2 ● Spring Boot 1.5.x ● EAP 7.1 ● Narayana (aligned to EAP 7.1) ● Undertow (aligned to EAP 7.1) ● AMQ 6.3 and 7.0 certifcation ● CXF 3.1 (aligned to EAP 7.1) ● HawtIO 2 ● Java 8
  40. 40. ● camel-asn1 ● camel-atomix ● camel-azure ● camel-caffeine ● camel-couchbase ● camel-crypto-cms ● camel-digitalocean ● camel-drill ● camel-elasticsearch5 ● camel-google-bigquery ● camel-google-pubsub ● camel-reactor ● camel-rest-swagger ● camel-sjms2 ● camel-spring-cloud ● camel-spring-cloud-netfix ● camel-thrift ● camel-tika ● camel-twilio ● camel-zendesk ● camel-zookeeper-master ● camel-yql ● camel-aws ● camel-elasticsearch-rest ● camel-xhcange ● camel-wordpres ● camel-grpc ● camel-headersmap ● camel-iec60870 ● camel-json-fastjson ● camel-milo ● camel-mongodb3 ● camel-olingo4 ● camel-openstack ● camel-opentracing ● camel-pubnub ● camel-reactive-streams NEW CAMEL COMPONENTS
  41. 41. MANAGEMENT ● HawtIO V2 ● More consistent UI Look with the rest Of Red Hat products
  42. 42. Karaf
  43. 43. Benefts of FUSE on OpenShift Development ● Full lifecycle IDE support : create, test, build, deploy ● Quickstart templates for common integration scenarios allows developers new to the platform to get up and running quickly. ● App packaging optimized for containerized environment ideal for microservices architecture. ● Container builds integrated into development toolchain with options to build from source or binary, aligning with current tools and development workfow in use today. ● Tap into the power of the platform with easy-to-use extensions such as injection of dynamic confguration values. ● Automated build triggers and pipeline support give users a continuous integration and deployment environment out-of-the-box. ● Developers can focus on writing code and providing value to the business rather than worrying about creating docker based images and docker confguration fles for each application they create. Management ● Insight into integration workload using centralized monitoring of integration activities based on ElasticSearch and Kibana. ● Manual or automated administration of the runtime environment is a breeze leveraging administrative CLI, API, and UI. ● Integration-specifc management, monitoring and debugging puts users in complete control of their integration workloads running inside a container. Operations ● Build on an environment that can seamlessly scale from 1s to 100s of integration containers using point-and- click UI or automatable management controls. ● Virtualize integration services to provide location independence and automatic failover. ● Platform that automatically detects and recovers failed integration containers. ● Take advantage of advanced deployment options built into the platform such as rolling upgrade, canary, and blue-green deployments. Security ● Integration containers are built on the most secure container runtime on the planet based on RHEL. ● Services are independent and isolated, providing complete separation of integration execution. ● Network isolation provides additional security by restricting service visibility based on user-defned partitions. ● Confdential storage of protected information such as passwords and keys. ● Red Hat scans and reports on container security via Red Hat Container Catalog. Freshness scores are public, providing peace of mind. Red Hat patches security issues at the OS, JVM, and middleware level.Flexibility ● Runtime built on best-of-breed open source technologies (Kubernetes, Linux Containers) provides an open, fexible foundation for all service development. ● Container-native toolchain and ability to containerize existing workloads (lift and shift) provide ideal platform for greenfeld, brownfeld, and transitional workloads. ● Container-native, integrated middleware portfolio allows developers to choose the right tool for the job on a single platform. ● Polyglot environment gives teams the fexibility to implement services using the language of their choice. https://docs.google.com/document/d/18g4nmGJpV2aU8Ve0das04Hy_ZV2by9rs10k6wGOa_V4/edit
  44. 44. CHANGES FOR USERS ● No More Fabric v1 ● Major upgrade: from Karaf 2.4 to 4.2.x ● Most Karaf Shell commands renamed ● Extensive JMX MBean Changes ● Base bundles have changed ○ User defned features may need updating to pick up right bundles. ○ Recompile needed to pick up new versions of imported packages
  45. 45. NEW FEATURES ● OSGi R6 support (vs OSGi r5 in Karaf 2.4.x) ● Requires Java 8 ● More lightweight: Blueprint not needed ● Maven plugin to generate minimal Karaf servers. ● Shell improvements ● Undertow web provider ● Narayana TX Manager ● log4j, log4j2, and logback supported ● Typed confg fles
  46. 46. NO EMBEDDED AMQ BROKER ● No AMQ Broker == Lighterweight Karaf Server ● Faster startup ● Easier to troubleshoot AMQ issues ● Blueprint used to confgure connection factories
  47. 47. IMPLEMENTATION RECOMMENDATIONS ● Dependency Injection ● Camel XML DSL Support ● More dynamic service injection model ● Can lead to service timeouts ● Faster startup ● Camel Java DSL ● Better for Pure OSGi fans ● More static service injection modals SCRBLUEPRINT
  48. 48. Undertow ● Undertow is the default web container ● Jetty only supported as an HTTP client ● Does not affect: ○ Simple Wars ○ Servlets ● Affects ○ Customized jetty xml confgurations ○ Bundles using Jetty specifc APIs like some of their WebSocket apis.
  49. 49. Narayana ● New TX manager abstraction layer ● Existing JMS/JDBC connection factories need to be reconfgured.
  50. 50. EAP
  51. 51. NEW FEATURES ● Feature Parity ● 200+ Camel components supported ● More quickstarts
  52. 52. UNDERTOW/CXF CONSUMERS ● Added support for the native EAP undertow server on consumer endpoints for: ○ camel-undertow ○ camel-cxf ● Fuse EAP 6.x fat WAR workaround:. ○ Should switch to 'skinny' WAR deployments
  53. 53. CAMEL COMPONENTS ● Feature parity with other platforms ● 200+ camel components now supported. camel-ahc camel-ahc-ws camel-amqp camel-avro camel-avro camel-barcode camel-base64 camel-tarfile camel-beanio camel-box camel-coap camel-couchdb camel-dns camel-dropbox camel-elsql camel-exec camel-facebook camel-freemarker camel-git camel-github camel-infinispan camel-irc camel-jacksonxml camel-jbpm camel-jcache camel-jdbc camel-kubernetes camel-linkedin camel-metrics camel-mllp camel-mongodb camel-mybatis camel-nats camel-olingo2 camel-optaplanner camel-paho camel-pdf camel-rabbitmq camel-sap-netweaver camel-schematron camel-servicenow camel-sjms camel-smpp camel-snmp camel-splunk camel-spring-batch camel-spring-integration camel-spring-ldap camel-spring-redis camel-ssh camel-stax camel-syslog camel-bean-validator camel-twitter camel-undertow camel-vertx
  54. 54. IMPLEMENTATION RECOMMENDATIONS ● For JavaEE Developers ● Camel Java DSL ● IDE Tooling Support ● Spring Shops SPRING XMLCDI
  55. 55. MIGRATING TO FUSE 7 EAP ● Apps typically do not need a recompile ● Users need to follow the EAP 7.1 migration guide ● CXF workarounds should be removed ● wildfy-maven-plugin : port 9999 -> 9990 ● BOM updates recommended
  56. 56. Spring Boot
  57. 57. ● Custom fat jar layouts ● Secured endpoints ● API to expose JMX endpoints ● Support for transaction manager confguration ● Camel health checks exposed to actuator ● Camel Component Customizers SPRING BOOT 1.5 / CAMEL
  58. 58. STANDALONE ● Actually Supported in 6.3 but not promoted. ● Existing Examples just needs: ○ -Dfabric8.skip ○ Runnable jar is in target dir
  59. 59. MANAGEMENT ● HAWTIO V2 / Jolokia ● JMX and Actuator. ● https://github.com/hawtio/hawtio/tree/2.x/examples/springboot
  60. 60. MANAGEMENT
  61. 61. SUPPORTED SPRING BOOT COMPONENTS ● Spring Boot Web (Undertow) ● Actuator ● JTA/Narayana starter ● AMQ starter ● JDBC starter ● Security + Keycloak ● Camel Component Starters: https://goo.gl/CLiJ8x
  62. 62. UNDERTOW ● Undertow is our recommended Web Container ● Just a dependency change is need in the POM ● No Application changes should be needed ● Tomcat/JWS support is being sorted out
  63. 63. CONFIGURATION MANAGEMENT ● Standard SB ○ System Properties ○ Environment Variables ○ application.properties ● spring-cloud-kubernetes ○ Mapping confgmaps ○ Secrets ○ Auto-reload
  64. 64. SECURITY ● KeyCloak is Integration with Spring Security: https://goo.gl/DesZmg ● Use camel-servlet with spring-web
  65. 65. IMPLEMENTATION RECOMMENDATIONS ● Spring Boot Developers ● More fexible and re- usable EIP development. ● IDE Tooling Support ● Older Spring Shops XML DSLJava DSL Read more: http://goo.gl/F9TUJ3

×