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

Event-driven and serverless with Spring Cloud Function, Spring Cloud Stream, and Spring Native

Event-driven and serverless with Spring Cloud Function, Spring Cloud Stream, and Spring Native

C20b9829daddbee16e359b0a750660a5?s=128

Thomas Vitale

May 20, 2021
Tweet

Transcript

  1. Thomas Vitale Spring User Group Italy May 20th, 2021 Event-driven

    and serverless With Spring Cloud Function, Spring Cloud Stream, and Spring Native @vitalethomas
  2. Thomas Vitale • Senior Software Engineer at Systematic, Denmark. •

    Spring, Cloud Native, DevOps, Kubernetes, Application Security. • Author of “Cloud Native Spring in Action - With Spring Boot and Kubernetes” (Manning). About Me
  3. Functional Programming Paradigm Java 8 Functional Interfaces • Supplier<O> •

    Function<I,O> • Consumer<I> thomasvitale.com @vitalethomas
  4. Spring Cloud Function thomasvitale.com @vitalethomas

  5. Spring Cloud Function Promote the implementation of business logic via

    functions • Transparent type conversion of inputs and outputs • Function composition (imperative, reactive, hybrid) • Function arity (multiple inputs/outputs) • POJO functions • Deployment of functions as JARs • Reactive support thomasvitale.com @vitalethomas
  6. Spring Cloud Function Function composition Order Accepted Order Dispatched Dispatcher

    Service Function Composition (Overview) pack() label() Input data Output data Data processing thomasvitale.com @vitalethomas
  7. Spring Cloud Function Function composition pack() OrderAccepted Message Long label()

    Flux<Long> Flux<Order Dispatched Message> Function Composition (Details) thomasvitale.com @vitalethomas
  8. Spring Cloud Function Serverless and event-driven • Functions exposed as

    HTTP endpoints and/or messaging channels • Integration with serverless platform • AWS Lambda • Azure Functions • Google Cloud Functions • Integration with event brokers • Spring Cloud Stream (RabbitMQ, Kafka) @vitalethomas
  9. Spring Native thomasvitale.com @vitalethomas

  10. Spring Native Native executables with GraalVM • Bene fi ts

    • Instant startup • Instant peak performance • Reduced memory consumption • Drawbacks • Slow and heavy build process • Fewer runtime optimizations • Con fi g for re fl ection and proxies @vitalethomas
  11. Spring Cloud Stream thomasvitale.com @vitalethomas

  12. Spring Cloud Stream Event-driven microservices • Integration with event brokers

    (RabbitMQ, Kafka, Kafka Streams) • Bindings between functions and external messaging systems • Publish/Subscribe • Consumer Groups • Partitions thomasvitale.com @vitalethomas
  13. Spring Cloud Stream Application Model Destination Binder Destination Binding Kafka

    RabbitMQ Function Spring Boot Application Destination Binding Spring Cloud Stream - Application Model thomasvitale.com @vitalethomas
  14. Spring Cloud Stream RabbitMQ Consumer Producer Exchange Queue Queue Consumer

    Message Broker routes messages to routes messages to sends messages to receives messages from receives messages from AMQP message routing thomasvitale.com @vitalethomas
  15. Thomas Vitale Spring User Group Italy May 20th, 2021 Event-driven

    and serverless With Spring Cloud Function, Spring Cloud Stream, and Spring Native @vitalethomas