Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event-driven Joy with Quarkus, Kafka & Knative

Event-driven Joy with Quarkus, Kafka & Knative

Quarkus allows getting an easy way to start producing and consuming messages to Apache Kafka. With the OpenShift Serverless Operators, you can get started with serverless on Kubernetes using Knative Serving and Knative Eventing using Kafka as a source to trigger your services or functions.

Hugo Guerrero

March 25, 2021
Tweet

More Decks by Hugo Guerrero

Other Decks in Programming

Transcript

  1. @hguerreroo Event-driven Joy Using Quarkus, Kafka & Knative Hugo Guerrero

    (@hguerreroo) APIs & Messaging Developer Advocate Red Hat
  2. @hguerreroo 2 Hugo Guerrero Mexicano @ MA, USA Especialista de

    APIs & mensajeria | Promotor de open source | Viajero entusiasta de la historia y la comida @hguerreroo | hellokube.dev AGENDA Quarkus Overview Developer Joy Apache Kafka Overview Kafka Streams Serverless with Knative Overview with OpenShift KafkaSource
  3. @hguerreroo Request/Response & Event-driven 3 Synchronous & ephemeral Low composability

    Simplified model Low tolerance to failure Best practices evolved as REST Asynchronous and persistent Decoupled Highly composable Complex model High tolerance to failure Best practices are still evolving
  4. @hguerreroo Developer Joy 6 • Zero config, live reload in

    the blink of an eye • Remote development with Openshift • Integration with Dev Console • CodeReady Workspaces • Based on standards, but not limited • Unified configuration • No hassle native executable generation
  5. @hguerreroo Developer Joy 7 Quarkus + Native 12 MB Quarkus

    + JVM 73 MB Traditional Cloud-Native Stack 136 MB Reduced Memory Footprint Quarkus + Native (.016 secs) Quarkus + JVM (0.943 secs) Traditional Cloud-Native Stack (4.3 secs) Fast Startup Time Smaller Disk Footprint
  6. @hguerreroo Source: http://kafka.apache.org What is Apache Kafka? • Project originally

    created by LinkedIn ▪ publish/subscribe messaging system ▪ data-streaming platform ▪ distributed commit log 9
  7. @hguerreroo Source: http://kafka.apache.org What is Apache Kafka? • Project originally

    created by LinkedIn ▪ publish/subscribe messaging system ▪ data-streaming platform ▪ distributed commit log • Broader ecosystem besides broker Streams API Producer API Consumer API 3rd party tools Mirror Maker Connect 10
  8. @hguerreroo Source: http://kafka.apache.org Kafka Streams • Stream processing framework •

    Streams are Kafka topics (as input and output) • It’s really just a Java library to include in your application • Creates a topology of processing nodes (filter, map, join etc) acting on a stream ▪ Low level processor API ▪ High level DSL 12
  9. @hguerreroo Source: http://kafka.apache.org Evolution to Serverless 15 Service Microservice Function

    > Single Purpose > Stateless > Independently Scalable > Automated > Single Action > Ephemeral > Autonomous > Loosely-coupled f( )
  10. @hguerreroo Common infrastructure for consuming and producing events that will

    stimulate applications. Source: http://kafka.apache.org Knative 16 Knative Serving Knative Eventing An event-driven model that serves the container with your application and can "scale to zero".
  11. @hguerreroo Source: http://kafka.apache.org Knative Eventing 17 ▪ Brokers ✓ Built-in

    Event Filtering ✓ Based on types or attributes ✓ Multiple event types ✓ Multi-tenant ▪ Channels ✓ Event Fanout to multiple subscribers ✓ Same event type ✓ Single-tenant