Java SDK
Build distributed applications using the Dapr Java SDK. The Dapr Java SDK provides client libraries and Spring Boot integration to interact with Dapr building blocks and APIs.
Start hereโ
Quickstarts
Learn hands-on
Durable Execution & Dapr University ยท Learn this hands-onDapr 101: State Management, Service Invocation, and Pub/Sub APIsLearn Dapr's core building blocks โ state management, service invocation, and pub/sub โ through hands-on coding.Start the trackElsewhere in Java
- Workflows with Java
- AI agents: Spring AI
Resourcesโ
Prerequisites:
- JDK 11+ (Download)
- Maven 3.x or Gradle 6.x
- Dapr Java Client/Server SDK
Installationโ
Maven
Add the following to your pom.xml:
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>1.xx.x</version>
</dependency>
Gradle
Add the following to your build.gradle:
dependencies {
implementation 'io.dapr:dapr-sdk:1.xx.x'
}
If you're using Spring Boot, check out the Spring Boot Integration, which provides Spring Data abstractions, Spring Messaging patterns, and auto-configuration for a more Spring-native development experience.
Dapr Client APIsโ
Use the Dapr Client to interact with Dapr building blocks and APIs with Java-specific examples and code samples.
Dapr Serverโ
Build services that can be invoked by other services and subscribe to topics using Java.
Service Invocation Server
Create services that can be invoked by other Dapr applications
Advanced Featuresโ
Spring Boot Integrationโ
Leverage the Spring Boot programming model with Dapr using the dapr-spring-boot-starter integration. This provides familiar Spring abstractions including:
- Spring Data Integration: Use
CrudRepositoryandKeyValueTemplatefor state management - Spring Messaging: Use
DaprMessagingTemplateand@Topicannotations for pub/sub - Auto-Configuration: Automatic bean discovery and dependency injection
- Testcontainers Support: Easy testing with integrated Dapr containers