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

Dapr for Java Developers (JJUG)

Salaboy
February 17, 2025

Dapr for Java Developers (JJUG)

For more information visit: https://www.salaboy.com

Salaboy

February 17, 2025
Tweet

More Decks by Salaboy

Other Decks in Technology

Transcript

  1. Why am I here? I am here to gather feedback

    from the Java community. Spring Boot and Quarkus integrations are in active development, we need feedback. It is a great opportunity to contribute to an Open Source project with your Java expertise.
  2. Agenda 1. Introduction a. Development challenges b. Kubernetes & Containers

    c. What are our applications doing 80% of the time? 2. What is Dapr? Why should I care? 3. Demo
  3. The challenge: to focus on what matters Developers are often

    distracted with details around: All this to solve business problems! Application Configuration Libraries and Dependencies … more, and more non-functional requirements Infrastructure Environment Runtime
  4. Some time ago ... Application Servers • Security • Transaction

    management • Connection pools • Service discovery • Messaging • Load balancing • etc …
  5. But… • Shared CPU, memory and File System • Apps

    depends on the application server's libraries • ClassLoader issues • Promoted silo-ed operations vs development
  6. With the rise of containers • Conventions over configuration •

    Simplicity • One JVM per application • Much more aligned for microservices • A better development and runtime environment
  7. But… I still need to worry about libraries/dependencies and some

    core services that were once provided by application servers.
  8. But what are our applications doing 80% of the time?

    • How many of your applications are reading or storing data? • How many of your applications are consuming and emitting events? • How many of your applications are calling other services?
  9. The challenge: to focus on what matters Developers are often

    distracted with details around: All this to solve business problems! Environment Runtime Libraries and Dependencies Infrastructure Application Configuration ✅ ✅
  10. What is Dapr? Why you should care? • Distributed application

    runtime • A Kubernetes Extension • Provides application-level APIs to interact with other services and infrastructure
  11. Let’s run this app on Kubernetes • To run this

    app in Kubernetes: • Create a cluster • Install Dapr • Install RabbitMQ and PostgreSQL • Install the app services
  12. Ok, but.. This is way too much for developers! To

    get this working we need: • A Kubernetes Cluster • Install Dapr • Configure infrastructure to be accessible using Components • Write a lot of YAML
  13. Java APIs and Spring - Spring developers expect the “client”

    lifecycle to be managed - Spring developers already know how to: - Deal with state (Spring Data) - Publishing and subscribing to messages (Spring Kafka, Pulsar, RabbitMQ) - Scheduling async Jobs with @Scheduled 👀👀 👀
  14. Dapr for Spring Boot - Dapr integrates nicely with the

    Spring & Spring Boot ecosystem - Spring developers can use the Dapr APIs without the need of a Kubernetes Cluster or even installing Dapr - It relies on Testcontainers to bootstrap Dapr from your Spring Boot applications - It integrates the Dapr APIs with the Spring programming model
  15. The Dapr Spring Boot Starter • State management • PubSub

    • Secrets • Workflows • Among other APIs
  16. Testing Dapr-enabled Spring Boot apps Dapr Sidecar Dapr Control Plane

    Services Spring Boot Application Infrastructure
  17. Testing Dapr-enabled Spring Boot apps Dapr Sidecar Dapr Control Plane

    Services Message Broker Spring Boot Application DB
  18. Dapr & the Spring programming model - Spring developers use

    Spring Data to store and retrieve data - Spring developers use Spring Messaging to publish and subscribe to messages - Workflows and Spring Developers
  19. How it works? App Dapr Sidecar Dapr Control Plane Services

    Spring Data Repository KeyValue Store DaprClient The app doesn’t have any dependency to the infrastructure Dapr handles the connection pool and adds resiliency policies to all connections with infrastructure
  20. How it works? App DaprClient The app doesn’t have any

    dependency to the infrastructure Dapr handles the connection pool and adds resiliency policies to all connections with infrastructure Dapr Sidecar Dapr Control Plane Services Spring Messaging Kafka
  21. Dapr Workflows for Durable executions Register Customer Book Customer Follow

    up Wait for Customer to reachout Create complex service orchestrations that are fault tolerant and resilient.
  22. Helping devs to focus on what matters Let’s code some

    new features! Environment Runtime Libraries and Dependencies Infrastructure Application Configuration ✅ ✅ ✅ ✅
  23. We need your help We need your help to make

    this integration awesome! Get in touch if you want to contribute. I am happy to mentor anyone who wants to contribute to Open Source.