dapr / dapr/java-sdk

Refactor Spring Boot documentation and spring-boot-examples

Open
#1,553 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
300
Forks
230
Avg merge
1d 20h
Merged PRs (30d)
4

Description

## Describe the proposal

The Spring Boot documentation provides a high-level introduction to using Dapr through the Dapr Spring Boot Starter and Dapr Spring Boot Starter Tests, which heavily integrate with Testcontainers.

Currently, the `spring-boot-examples/` directory has three applications:
- Producer: To demonstrate basic APIs such as PubSub and StateStore integrated with Spring
- Consumer: To demonstrate subscriptions, but also to demonstrate how to test these scenarios.
- Workflow: Showing some basic workflow patterns

The aim of these examples is to provide concrete application examples that Spring Boot developers can understand and copy. The goal is not to provide simple/hello world examples on how to use the Dapr APIs, as this is already covered in the `examples/` directory.

To improve the documentation and guides that target Spring Boot developers, the examples should cover:
1) PubSub (`pubsub` directory): move the producer and consumer apps to this directory
2) Service To Service Invocations (`service-to-service`): create an example that shows Service to Service invocation integrated with RestTemplate and Microcks for testing
3) Workflows (`workflows`): This should include, simple workflow app (`simple-workflow`), workflow app with PubSub (`event-workflow`), workflow patterns (`patterns`), which should include examples from this repository too (https://github.com/diagrid-labs/workflow-patterns-spring-boot) , Spring AI examples related to workflows (`spring-ai`) , Observability and workflows (`observability`)

The Spring Boot documentation should be updated to cover the following sections (https://docs.dapr.io/developing-applications/sdks/java/spring-boot/):
- [x] Basics, dependencies, injection, basic information about using Dapr and testing with Testcontainers
- [ ] PubSub section, which includes the description of the refactored PubSub example (https://docs.dapr.io/developing-applications/sdks/java/spring-boot/#using-spring-messaging-for-producing-and-consuming-events)
- [ ] Service to Service Invocation, to cover a newly created example
- [ ] Workflows section (https://docs.dapr.io/developing-applications/sdks/java/spring-boot/#using-dapr-workflows-with-spring-boot) expanded with patterns, examples, Spring AI and observability
- [ ] Reference links to presentations and online resources

On top of this, we should highlight the Spring Boot integration at the top of the Java SDK page: https://docs.dapr.io/developing-applications/sdks/java/, so folks reaching this page can jump straight to Spring Boot instead of looking into the plain Java approach.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.