Slide 1

Slide 1 text

The evolution of cloud native software (Dapr for Java Developers) &

Slide 2

Slide 2 text

https://www.diagrid.io/blog/dapr-for-java-developers https://www.diagrid.io/blog/dapr-for-spring-boot

Slide 3

Slide 3 text

@Salaboy Mauricio Salatino Software Engineer @ Diagrid https://salaboy.com

Slide 4

Slide 4 text

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.

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Some time ago ... Application Servers • Security • Transaction management • Connection pools • Service discovery • Messaging • Load balancing • etc …

Slide 8

Slide 8 text

But… • Shared CPU, memory and File System • Apps depends on the application server's libraries • ClassLoader issues • Promoted silo-ed operations vs development

Slide 9

Slide 9 text

With the rise of containers • Conventions over configuration • Simplicity • One JVM per application • Much more aligned for microservices • A better development and runtime environment

Slide 10

Slide 10 text

Containerized Java Application

Slide 11

Slide 11 text

But… I still need to worry about libraries/dependencies and some core services that were once provided by application servers.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Application on Kubernetes

Slide 14

Slide 14 text

Java on Kubernetes

Slide 15

Slide 15 text

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?

Slide 16

Slide 16 text

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 ✅ ✅

Slide 17

Slide 17 text

The challenge now is abstract infra and libs

Slide 18

Slide 18 text

dapr.io

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

What is Dapr? Why you should care? • Distributed application runtime • A Kubernetes Extension • Provides application-level APIs to interact with other services and infrastructure

Slide 21

Slide 21 text

With Dapr

Slide 22

Slide 22 text

For example: producer -> consumer apps

Slide 23

Slide 23 text

For example: producer -> consume apps

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

Diagrid Conductor https://conductor.diagrid.io/

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

The Dapr Java SDK

Slide 28

Slide 28 text

Creating a Dapr Client and using the APIs

Slide 29

Slide 29 text

Creating a Dapr Client and using the APIs

Slide 30

Slide 30 text

Creating a Dapr Client and using the APIs

Slide 31

Slide 31 text

Creating a Dapr Client and using the APIs

Slide 32

Slide 32 text

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 👀👀 👀

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

The Dapr Spring Boot Starter ● State management ● PubSub ● Secrets ● Workflows ● Among other APIs

Slide 36

Slide 36 text

@Autowired Dapr Client

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

Testing Dapr-enabled Spring Boot apps Dapr Sidecar Dapr Control Plane Services Message Broker Spring Boot Application DB

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

Spring Data and Repositories

Slide 41

Slide 41 text

Spring Data and Repositories

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Spring Messaging (Kafka, Pulsar, RabbitMQ)

Slide 44

Slide 44 text

Subscribe to async messages

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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.

Slide 47

Slide 47 text

Integrating with your existing systems

Slide 48

Slide 48 text

Interacting with workflows

Slide 49

Slide 49 text

Helping devs to focus on what matters Let’s code some new features! Environment Runtime Libraries and Dependencies Infrastructure Application Configuration ✅ ✅ ✅ ✅

Slide 50

Slide 50 text

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.

Slide 51

Slide 51 text

ご静聴ありがとうご ざいました ! @salaboy / @daprdev / @diagridio dapr.io diagrid.io diagrid.io

Slide 52

Slide 52 text

Thanks! @salaboy / @daprdev / @diagridio dapr.io diagrid.io diagrid.io

Slide 53

Slide 53 text

Dapr for Java Developers &