Slide 1

Slide 1 text

@kevindubois #Camel #Quarkus #Devoxx Serverless Integration with Camel Quarkus Kevin Dubois Developer Advocate, Red Hat

Slide 2

Slide 2 text

@kevindubois #Camel #Quarkus #Devoxx Why Serverless? Why Enterprise Integration? Why Apache Camel? Why Quarkus?

Slide 3

Slide 3 text

@kevindubois #Camel #Quarkus #Devoxx Kevin Dubois ● Principal Developer Advocate at Red Hat ● Previously: (Lead) Software Engineer / Architect, mostly in USA ● Speak English, Dutch, French, Italian fluently… and a tiny bit of German and Spanish ● Passionate about improving Dev Experience with Open Source ● And … An Antwerp Native! Linkedin: kevindubois Github: kdubois @kevindubois

Slide 4

Slide 4 text

@kevindubois #Camel #Quarkus #Devoxx Enterprise Integration

Slide 5

Slide 5 text

@kevindubois #Camel #Quarkus #Devoxx 5 What problem needs to be resolved? Sometimes it’s a ‘MICRO-problem’, for instance ... ● Sometimes the focus is on data/protocol transformation. ● This is an integration problem. “I need this information in this specific format and protocol !”

Slide 6

Slide 6 text

@kevindubois #Camel #Quarkus #Devoxx 6 … and, some other times you have a ‘MACRO-problem’, for instance: ● Here the focus is on interconnecting sources and destinations efficiently. ➔ This also... is an integration problem. “I want an easy and standard way to interconnect my app”

Slide 7

Slide 7 text

@kevindubois #Camel #Quarkus #Devoxx 7 “Good” Integration Bespoke/Custom made Integration Integration with reusable & standard components ● As a quick win, often a problem is initially resolved in a custom manner. ● In the long run this results to be counterproductive.

Slide 8

Slide 8 text

@kevindubois #Camel #Quarkus #Devoxx 🛞Mainly, it’s about not reinventing the wheel 🛞

Slide 9

Slide 9 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 10

Slide 10 text

@kevindubois #Camel #Quarkus #Devoxx Apache Camel

Slide 11

Slide 11 text

@kevindubois #Camel #Quarkus #Devoxx Apache Camel 11 Swiss knife of integration Solve integration problem by applying best practices out of the box. Even with microservice architectures. Patterns 300+ Components Lightweight Runtimes Data Formats Packed with 300+ components such as databases, message queues, APIs. Quarkus, Standalone, Spring Boot,Application Servers, and natively on Cloud. Translate messages in multiple formats, and industry standard formats from finance, telco, health-care, and more

Slide 12

Slide 12 text

@kevindubois #Camel #Quarkus #Devoxx Camel “Routes” 12 Source Sink Action

Slide 13

Slide 13 text

@kevindubois #Camel #Quarkus #Devoxx https://camel.apache.org/components

Slide 14

Slide 14 text

@kevindubois #Camel #Quarkus #Devoxx Apache Camel 14 Swiss knife of integration Simple, self-explained Domain Specific Language. Available in Java, YAML, XML DSLs Reactive Routing Engine Backlog Tracer/Tracer Comprehensive Tooling Back pressure model. Smooth flow control. Better thread management. Capturing a trace inside and between Camel route. For better observability Support autocomplete, correction on multiple IDE with LSP Server. Graphical data mapper. from(“kafka:topic”) .to(“grpc:endpoint”)

Slide 15

Slide 15 text

@kevindubois #Camel #Quarkus #Devoxx Apache Camel Community 15 Source: https://www.apache.org/foundation/docs/FY2021AnnualReport.pdf ➢ The biggest and most active community for open source integration software ➢ 600+ unique contributors ➢ 3800+ pull requests (mostly from external contributors) ➢ 15+ years of development and one of the most active Apache projects

Slide 16

Slide 16 text

@kevindubois #Camel #Quarkus #Devoxx Serverless

Slide 17

Slide 17 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 18

Slide 18 text

@kevindubois #Camel #Quarkus #Devoxx Serverless “Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment” -- CNCF Definition, https://www.cncf.io/blog/2018/02/14/cncf-takes-first-step-towards-serverless-computing/

Slide 19

Slide 19 text

@kevindubois #Camel #Quarkus #Devoxx Immutable revisions Deploy new features: performing canary, A/B or blue-green testing with gradual traffic rollout with no sweat and following best practices. No need to configure number of replicas, or idling. Scale to zero when not in use, auto scale to thousands during peak, with built-in reliability and fault-tolerance. Automatic scaling Ready for the Hybrid Cloud Truly portable serverless running anywhere Kubernetes runs, that is on-premises or on any public cloud. Leverage data locality and SaaS when needed. Event Driven Architectures Build loosely coupled & distributed apps connecting with a variety of built-in or third-party event sources or connectors powered by Operators. Any programming language Use any programming language or runtime of choice. From Java, Python, Go and JavaScript to Quarkus, SpringBoot or Node.js. Simplified developer experience to deploy applications/code on serverless containers abstracting infrastructure & focusing on what matters. Containers made easy prem aws azur e Knative is an Open Source, Cloud Agnostic Solution to build Serverless and Event Driven Applications Knative

Slide 20

Slide 20 text

@kevindubois #Camel #Quarkus #Devoxx Serverless Operational Benefits Over provisioning Time in capacity planning IT cost of idle resources Under provisioning Lost business revenue Poor quality of service More applications Direct line between IT costs & business revenue NOT Serverless with Serverless

Slide 21

Slide 21 text

@kevindubois #Camel #Quarkus #Devoxx “Traditional” Java wasn’t designed for Containers & Serverless At the expense of startup speed Rich dynamic behavior built for mutable systems Designed to be long-running Yet containers are primarily immutable Designed for Throughput At the expense of footprint ➔ Java likes to uses as many resources as it can get

Slide 22

Slide 22 text

@kevindubois #Camel #Quarkus #Devoxx When you can’t scale fast enough…

Slide 23

Slide 23 text

@kevindubois #Camel #Quarkus #Devoxx 23 Serverless Adoption 6.1% Java https://serverless.com/blog/2018-serverless-community-survey-huge-growth-usage/ 62.9% Node.js 20.8% Python 6.4% Go 6.1% Java 3.8% C#

Slide 24

Slide 24 text

@kevindubois #Camel #Quarkus #Devoxx What about our existing Java skills & Expertise?

Slide 25

Slide 25 text

@kevindubois #Camel #Quarkus #Devoxx 25 Supersonic. Subatomic. Java.

Slide 26

Slide 26 text

@kevindubois #Camel #Quarkus #Devoxx Quarkus is a Java Stack that : ★ Is based on Java standards ★ Moves as much as possible to build phase ★ Minimizes runtime dependencies ★ Maximizes dead code elimination ★ Enables Native Build with GraalVM / Mandrel ○ (without having to know how to work with GraalVM!) ★ Brings Developer joy !

Slide 27

Slide 27 text

@kevindubois #Camel #Quarkus #Devoxx 27 Supersonic Subatomic Java Quarkus + Native (via GraalVM) 12 MB Quarkus + JVM (via OpenJDK) 73 MB Traditional Cloud-Native Stack 136 MB Quarkus + Native (via GraalVM) 0.016 Seconds Quarkus + JVM (via OpenJDK) 0.943 Seconds Traditional Cloud-Native Stack 4.3 Seconds

Slide 28

Slide 28 text

@kevindubois #Camel #Quarkus #Devoxx A cohesive platform for optimized developer joy: ● Quick code-build-verify turnaround ○ Live reload in the blink of an eye ○ Continuous Testing ● No hassle native executable generation ● Many developer-friendly features: Dev services; Hibernate Panache; simplified logging; IDE plugins; Kubernetes & Openshift Extensions, etc Quarkus brings Developer Joy

Slide 29

Slide 29 text

@kevindubois #Camel #Quarkus #Devoxx Apache Camel extensions for Quarkus (or just “Camel Quarkus”)

Slide 30

Slide 30 text

@kevindubois #Camel #Quarkus #Devoxx code.quarkus.io Camel extensions for Quarkus

Slide 31

Slide 31 text

@kevindubois #Camel #Quarkus #Devoxx Demo

Slide 32

Slide 32 text

@kevindubois #Camel #Quarkus #Devoxx Demo

Slide 33

Slide 33 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 34

Slide 34 text

@kevindubois #Camel #Quarkus #Devoxx rest("/getresults") .get() .bean("vote", "orderedList()") .marshal().json() .convertBodyTo(String.class);

Slide 35

Slide 35 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 36

Slide 36 text

@kevindubois #Camel #Quarkus #Devoxx rest("/favstack") .post() .consumes("application/json") .produces("application/json") .to("kafka:{{kafka.topic.name}}" );

Slide 37

Slide 37 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 38

Slide 38 text

@kevindubois #Camel #Quarkus #Devoxx from("kafka:{{kafka.topic.name}}" ) .unmarshal().json(JsonLibrary.Jackson, Response.class) .transacted() .to("bean:vote?method=updateCounter(${body.getShortname})" );

Slide 39

Slide 39 text

@kevindubois #Camel #Quarkus #Devoxx Quarkus Dev UI

Slide 40

Slide 40 text

@kevindubois #Camel #Quarkus #Devoxx @kevindubois #Camel #Quarkus #Devoxx red.ht/devoxx22

Slide 41

Slide 41 text

@kevindubois #Camel #Quarkus #Devoxx “@kevindubois asks at #Devoxx what my favorite IDE/editor is. It is xyz”

Slide 42

Slide 42 text

@kevindubois #Camel #Quarkus #Devoxx fromF("twitter-search:// %s?", searchTerm) .process(new TweetInfoProcessor ()) .choice() .when(simple("${body} ~~ openshiftdevspaces" )) .setBody(simple("{\"shortname\":\"openshiftdevspaces \"} ")) .to("direct:sendToKafka" ) .otherwise().log("no match"); from("direct:sendToKafka" ) .to("kafka:{{kafka.topic.name}}" );

Slide 43

Slide 43 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 44

Slide 44 text

@kevindubois #Camel #Quarkus #Devoxx > kamel run roll-die.yaml ● 1 source code file web service roll-die.yam l ● 1 CLI command Create integration file Running on OpenShift 1 Execute CLI Tools 2 3 Camel K For Developers - from: uri: "platform-http:/roll-die" steps: - setBody: simple: "roll: ${random(1,6)}” 44

Slide 45

Slide 45 text

@kevindubois #Camel #Quarkus #Devoxx Wrap up ★ Apache Camel = an integration toolkit with 350+ connectors ★ Camel Quarkus = developer joy + fast startup + easy integration ★ Scale from 0 and easy deployments with Knative ★ Also cool: Low/No Code with Camel K and Kamelets

Slide 46

Slide 46 text

@kevindubois #Camel #Quarkus #Devoxx @kevindubois #Camel #Quarkus #Devoxx github.com/kdubois/CamelQuarkusVoter developers.redhat.com/developer-sandbox

Slide 47

Slide 47 text

@kevindubois #Camel #Quarkus #Devoxx

Slide 48

Slide 48 text

@kevindubois #Camel #Quarkus #Devoxx Thank you!