Skip to content

Commit 21703ec

Browse files
authored
docs: lead the README with durable workflows and trim prerequisites (#1887)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 4f8700b commit 21703ec

1 file changed

Lines changed: 44 additions & 47 deletions

File tree

‎README.md‎

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/io.dapr/dapr-sdk.svg?label=Maven%20Central&style=flat)](https://central.sonatype.com/artifact/io.dapr/dapr-sdk) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/dapr/java-sdk/.github%2Fworkflows%2Fbuild.yml?branch=master&label=Build&logo=github)](https://github.com/dapr/java-sdk/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/dapr/java-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/dapr/java-sdk) [![GitHub License](https://img.shields.io/github/license/dapr/java-sdk?style=flat&label=License&logo=github)](https://github.com/dapr/java-sdk/blob/master/LICENSE) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdapr%2Fjava-sdk.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdapr%2Fjava-sdk?ref=badge_shield) [![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/dapr/java-sdk?query=type%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22&label=Good%20first%20issues&style=flat&logo=github)](https://github.com/dapr/java-sdk/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) [![Discord](https://img.shields.io/discord/778680217417809931?label=Discord&style=flat&logo=discord)](http://bit.ly/dapr-discord) [![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCtpSQ9BLB_3EXdWAUQYwnRA?style=flat&label=YouTube%20views&logo=youtube)](https://youtube.com/@daprdev) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/daprdev?logo=x&style=flat)](https://twitter.com/daprdev)
44

5-
This is the Dapr SDK for Java, including the following features:
5+
The Java SDK for [Dapr](https://dapr.io): durable workflows, actors, pub/sub, state, service invocation, bindings and Spring Boot integration.
66

7-
* PubSub
8-
* Service Invocation
9-
* Binding
10-
* State Store
11-
* Actors
12-
* Workflows
7+
* **Docs:** [Java SDK documentation](https://docs.dapr.io/developing-applications/sdks/java/)
8+
* **API reference:** [Javadoc](https://dapr.github.io/java-sdk/)
9+
10+
## Workflows
11+
12+
Write durable workflows in plain Java with `dapr-sdk-workflows`. Workflow state is persisted by Dapr, so a workflow picks up where it left off after a crash or restart.
13+
14+
* [Workflow overview](https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/)
15+
* [Java SDK documentation](https://docs.dapr.io/developing-applications/sdks/java/)
16+
* [Workflow examples](./examples/src/main/java/io/dapr/examples/workflows/)
1317

1418
## Getting Started
1519

@@ -33,30 +37,12 @@ flowchart LR
3337
For the full list of available APIs, see the [Dapr API reference](https://docs.dapr.io/reference/api/)
3438

3539
### Pre-Requisites
36-
* SDKMAN! installed (recommended):
37-
* [SDKMAN!](https://sdkman.io)
38-
* Java IDE installed:
39-
* [IntelliJ](https://www.jetbrains.com/idea/download/)
40-
* [Eclipse](https://www.eclipse.org/downloads/)
41-
* [Apache NetBeans](https://netbeans.apache.org/download/index.html)
42-
* [Visual Studio Code](https://code.visualstudio.com/Download)
43-
* Any other IDE for Java that you prefer.
44-
* Install one of the following build tools for Java:
45-
* [Maven 3.x](https://maven.apache.org/install.html)
46-
* [Gradle 6.x](https://gradle.org/install/)
47-
* If needed, install the corresponding plugin for the build tool in your IDE, for example:
48-
* [Maven in IntelliJ](https://www.jetbrains.com/help/idea/maven.html)
49-
* [Gradle in IntelliJ](https://www.jetbrains.com/help/idea/gradle-settings.html)
50-
* [Maven in Eclipse with m2e](https://projects.eclipse.org/projects/technology.m2e)
51-
* [Gradle in Eclipse with Buildship](https://projects.eclipse.org/projects/tools.buildship)
52-
* An existing Java Maven or Gradle project. You may also start a new project via one of the options below:
53-
* [New Maven project in IntelliJ](https://www.jetbrains.com/help/idea/maven-support.html#create_new_maven_project)
54-
* [Maven in 5 minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
55-
* [Install toxiproxy-server binary](https://github.com/Shopify/toxiproxy/releases)
40+
* JDK 17 or later
41+
* [Maven 3.x](https://maven.apache.org/install.html) or [Gradle](https://gradle.org/install/)
42+
* An existing Java Maven or Gradle project. To start a new one, see [Maven in 5 minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).
43+
* The [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/), to run your application with a Dapr sidecar locally
5644

57-
### Install JDK
58-
59-
If using [SDKMAN!](https://sdkman.io), execute `sdk env install` to install the required JDK.
45+
IDE setup and the tools needed to work on the SDK itself are under [Development](#development).
6046

6147
### Importing Dapr's Java SDK
6248

@@ -69,7 +55,9 @@ Two BOMs are published:
6955
- **`io.dapr:dapr-sdk-bom`** — core SDK modules (`dapr-sdk`, `dapr-sdk-actors`, `dapr-sdk-workflows`, `dapr-sdk-autogen`, `durabletask-client`, `testcontainers-dapr`) plus security-patched transitive dependencies (Netty, Jackson, commons-compress, commons-codec).
7056
- **`io.dapr.spring:dapr-spring-bom`** — Spring-specific modules (`dapr-sdk-springboot`, `dapr-spring-*`). Imports `dapr-sdk-bom` transitively, so Spring users only need this single BOM.
7157

72-
Pick the one that matches your project. Importing a BOM ensures you inherit security fixes for transitive dependencies like the Netty CVEs.
58+
`durabletask-client` is the gRPC client and worker for the Durable Task engine that runs Dapr workflows; `dapr-sdk-workflows` pulls it in, so you do not add it yourself.
59+
60+
Pick the one that matches your project. Importing a BOM ensures you inherit security fixes for transitive dependencies like the Netty CVEs. With a BOM imported, the version is set once on the BOM and left off each Dapr dependency.
7361

7462
##### Core (non-Spring) projects
7563

@@ -90,23 +78,20 @@ For Maven:
9078
</dependencyManagement>
9179

9280
<dependencies>
93-
<!-- Dapr's core SDK with all features, except Actors. -->
81+
<!-- Dapr's core SDK with all features, except Actors and Workflows. -->
9482
<dependency>
9583
<groupId>io.dapr</groupId>
9684
<artifactId>dapr-sdk</artifactId>
97-
<version>1.19.0</version>
9885
</dependency>
99-
<!-- Dapr's SDK for Actors (optional). -->
86+
<!-- Dapr's SDK for Workflows (optional). -->
10087
<dependency>
10188
<groupId>io.dapr</groupId>
102-
<artifactId>dapr-sdk-actors</artifactId>
103-
<version>1.19.0</version>
89+
<artifactId>dapr-sdk-workflows</artifactId>
10490
</dependency>
105-
<!-- Dapr's SDK integration with SpringBoot (optional). -->
91+
<!-- Dapr's SDK for Actors (optional). -->
10692
<dependency>
10793
<groupId>io.dapr</groupId>
108-
<artifactId>dapr-sdk-springboot</artifactId>
109-
<version>1.19.0</version>
94+
<artifactId>dapr-sdk-actors</artifactId>
11095
</dependency>
11196
...
11297
</dependencies>
@@ -119,8 +104,10 @@ For Gradle:
119104
dependencies {
120105
implementation platform('io.dapr:dapr-sdk-bom:1.19.0')
121106
122-
// Dapr's core SDK with all features, except Actors.
123-
compile('io.dapr:dapr-sdk:1.19.0')
107+
// Dapr's core SDK with all features, except Actors and Workflows.
108+
implementation 'io.dapr:dapr-sdk'
109+
// Dapr's SDK for Workflows (optional).
110+
implementation 'io.dapr:dapr-sdk-workflows'
124111
// Dapr's SDK for Actors (optional).
125112
implementation 'io.dapr:dapr-sdk-actors'
126113
}
@@ -204,9 +191,11 @@ For Maven:
204191
For Gradle:
205192
```groovy
206193
dependencies {
207-
implementation 'io.dapr:dapr-sdk:1.19.0'
208-
implementation 'io.dapr:dapr-sdk-actors:1.19.0'
209-
implementation 'io.dapr:dapr-sdk-springboot:1.19.0'
194+
def daprVersion = '1.19.0'
195+
196+
implementation "io.dapr:dapr-sdk:${daprVersion}"
197+
implementation "io.dapr:dapr-sdk-actors:${daprVersion}"
198+
implementation "io.dapr:dapr-sdk-springboot:${daprVersion}"
210199
}
211200
```
212201

@@ -248,7 +237,7 @@ You can find a [step-by-step tutorial showing this integration here](./spring-bo
248237

249238
### API Documentation
250239

251-
Please, refer to our [Javadoc](https://dapr.github.io/java-sdk/) website.
240+
See the [Javadoc](https://dapr.github.io/java-sdk/) for the API reference, and the [Java SDK documentation](https://docs.dapr.io/developing-applications/sdks/java/) for guides.
252241

253242
### Reactor API
254243

@@ -325,6 +314,14 @@ Most exceptions thrown from the SDK are instances of `DaprException`. `DaprExcep
325314
326315
## Development
327316
317+
### Tools
318+
319+
* JDK 17. With [SDKMAN!](https://sdkman.io), run `sdk env install` in the repo root to install the JDK pinned in `.sdkmanrc`.
320+
* Maven is not needed: use the wrapper, `./mvnw`.
321+
* A Java IDE, for example [IntelliJ](https://www.jetbrains.com/idea/download/), [Eclipse](https://www.eclipse.org/downloads/), [Apache NetBeans](https://netbeans.apache.org/download/index.html) or [Visual Studio Code](https://code.visualstudio.com/Download), with Maven support if it needs a plugin:
322+
* [Maven in IntelliJ](https://www.jetbrains.com/help/idea/maven.html)
323+
* [Maven in Eclipse with m2e](https://projects.eclipse.org/projects/technology.m2e)
324+
328325
### Update URL to fetch proto files
329326
330327
Change the `dapr.proto.baseurl` property below in [pom.xml](./pom.xml) to point to the URL for the desired commit hash in Git if you need to target a proto file that is not been merged into master yet.
@@ -349,7 +346,7 @@ Note: You may need to run `./mvnw clean` after changing this setting to remove a
349346
### Running Integration Tests (ITs)
350347
351348
#### Pre-Requisites
352-
* [Pre-Requisites for the SDK](#pre-requisites)
349+
* The [development tools](#tools)
353350
* Docker installed and running
354351
* [Docker Desktop](https://www.docker.com/products/docker-desktop)
355352
* Bash shell
@@ -365,7 +362,7 @@ As a starting point for running the Integration Tests, first run `./mvnw clean i
365362
366363
#### Backing services (managed automatically by Testcontainers)
367364
368-
The integration tests use [Testcontainers](https://testcontainers.com/) to start and manage every backing service they depend on — Redis, Zipkin, MongoDB, Kafka, and the Dapr control plane (`placement` and `scheduler`) — automatically at test runtime.
365+
The integration tests use [Testcontainers](https://testcontainers.com/) to start and manage every backing service they depend on — Redis, Zipkin, MongoDB, Kafka, [Toxiproxy](https://github.com/Shopify/toxiproxy) for the resiliency tests, and the Dapr control plane (`placement` and `scheduler`) — automatically at test runtime.
369366
370367
There is no separate step to bring these services up: you only need a running Docker daemon. Testcontainers pulls the required images and starts/stops the containers as the tests run.
371368

0 commit comments

Comments
 (0)