Dapr SDK for Java
Go to file
Cassie Coyle 7af3a8737d
Add Tool Calling to Java SDK (#1481) (#1556)
* Use Java Bean for connection details and add more tests (#1317)

* Use Java Bean for connection details and add more tests



* Simplify mock setup



* Adding even more tests for test coverage



---------






* Update CONTRIBUTING.md




* Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#1318)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...







* Fix URL building logic (#1320)

* Fix URL building logic



* Add test for query params



* Fix the assertion in the test



* Adjust the tests



* Remove uneeded changes from IT test



* Revert some unintended changes



* Simplify the testing a little bit



* Adjust the test to use ServerRequest



* Test removing things from method invoke controller



* Add query param encoding test



* Revert some unintended changes



* Some tiny styles



---------





* Generate updated javadocs for 1.14.1




* Add Conversation AI to Java SDK (#1235)

* Conversation first commit





* Add unit tests




* change ai to conv




* Move to single module




* Remove module




* Add Integration tests



* Update sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprConversationIT.java





* Fix things



* Address comments



* Import tag



* Address comments



* Make common config



* Address comments



* fix constant



* fix constant



* fix constant



* fix s



* Fix things



* Fix things



* Fix things



* Make common config



* Update README.md



* Update README.md



---------









* Add docs for usage of Jobs SDK (#1323)

* Add doc for jobs



* Add docs for Jobs



* Apply suggestions from code review




---------







* Use dapr/durabletask-java (#1336)

* microsoft durabletask-java -> dapr durabletask-java



* update another ref



* 1.5.2 release



* fix import order



* Sdk new changes



* Refine workflows



* add ;



* rm try



---------






* Update master version to 1.16.0-SNAPSHOT




* Renaming and exposing connection details (#1341)





* [Master] Fix Vulnerabilities (#1354)

* update okio



* rm unused dep



---------




* Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361)

* feat: Support for GRPC ssl



* add tests



* fix CI



* add back else if



* channel cleanup



* add root ca support



* checkstyles



* add insecure



* fix checkstyles



* use InsecureTrustManagerFactory



* fix test



---------






* Fix the issue with retries not happening correctly for Activities and Workflows (#1343)

* Add coverage for some properties (#1297)



* Make the DAPR version being used consistent across all tests (#1299)



* Separate Dapr constants from IT container constants (#1315)





* Use Java Bean for connection details and add more tests (#1317)

* Use Java Bean for connection details and add more tests



* Simplify mock setup



* Adding even more tests for test coverage



---------






* Update CONTRIBUTING.md




* Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#1318)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...







* Fix URL building logic (#1320)

* Fix URL building logic



* Add test for query params



* Fix the assertion in the test



* Adjust the tests



* Remove uneeded changes from IT test



* Revert some unintended changes



* Simplify the testing a little bit



* Adjust the test to use ServerRequest



* Test removing things from method invoke controller



* Add query param encoding test



* Revert some unintended changes



* Some tiny styles



---------





* Generate updated javadocs for 1.14.1




* Add Conversation AI to Java SDK (#1235)

* Conversation first commit





* Add unit tests




* change ai to conv




* Move to single module




* Remove module




* Add Integration tests



* Update sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprConversationIT.java





* Fix things



* Address comments



* Import tag



* Address comments



* Make common config



* Address comments



* fix constant



* fix constant



* fix constant



* fix s



* Fix things



* Fix things



* Fix things



* Make common config



* Update README.md



* Update README.md



---------









* Add docs for usage of Jobs SDK (#1323)

* Add doc for jobs



* Add docs for Jobs



* Apply suggestions from code review




---------







* Use dapr/durabletask-java (#1336)

* microsoft durabletask-java -> dapr durabletask-java



* update another ref



* 1.5.2 release



* fix import order



* Sdk new changes



* Refine workflows



* add ;



* rm try



---------






* Update master version to 1.16.0-SNAPSHOT




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix things




* Renaming and exposing connection details (#1341)





* [Master] Fix Vulnerabilities (#1354)

* update okio



* rm unused dep



---------




* Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361)

* feat: Support for GRPC ssl



* add tests



* fix CI



* add back else if



* channel cleanup



* add root ca support



* checkstyles



* add insecure



* fix checkstyles



* use InsecureTrustManagerFactory



* fix test



---------






* Address comments




* Fix things




* Fix things




---------





















* 1.5.4 (#1375)




* Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#1379)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...





* Bump fossas/fossa-action from 1.6.0 to 1.7.0 (#1380)

Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](https://github.com/fossas/fossa-action/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: fossas/fossa-action
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...






* Fix component spec parsing (#1370)

* Fix component spec parsing



* Fix component spec parsing



* Fix component spec metadata parsing



* fix checkstyle-error



---------






* chore: Add grpc keepalives (#1382)

* chore: Add grpc keepalives



* chore: Make grpc keepalive configurable



* chore: Fix review comments



* chore: Missing keepalive config for GRPC TLS INSECURE



* chore: Add test



* fix: Comment typo



---------




* Fix : Typo in code comments (#1381)

* Fix Typo in Comments



* Update review comments



---------





* Spring boot workflow patterns examples with mechanical markdown and tests (#1377)

* Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361)

* feat: Support for GRPC ssl



* add tests



* fix CI



* add back else if



* channel cleanup



* add root ca support



* checkstyles



* add insecure



* fix checkstyles



* use InsecureTrustManagerFactory



* fix test



---------






* spring boot workflow patterns initial version



* adding README for workflows



* adding child example



* updating examples to work with markdown tests



* running mechanical markdown for workflow examples



* Fix the issue with retries not happening correctly for Activities and Workflows (#1343)

* Add coverage for some properties (#1297)



* Make the DAPR version being used consistent across all tests (#1299)



* Separate Dapr constants from IT container constants (#1315)





* Use Java Bean for connection details and add more tests (#1317)

* Use Java Bean for connection details and add more tests



* Simplify mock setup



* Adding even more tests for test coverage



---------






* Update CONTRIBUTING.md




* Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#1318)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.4.0...v5.4.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...







* Fix URL building logic (#1320)

* Fix URL building logic



* Add test for query params



* Fix the assertion in the test



* Adjust the tests



* Remove uneeded changes from IT test



* Revert some unintended changes



* Simplify the testing a little bit



* Adjust the test to use ServerRequest



* Test removing things from method invoke controller



* Add query param encoding test



* Revert some unintended changes



* Some tiny styles



---------





* Generate updated javadocs for 1.14.1




* Add Conversation AI to Java SDK (#1235)

* Conversation first commit





* Add unit tests




* change ai to conv




* Move to single module




* Remove module




* Add Integration tests



* Update sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprConversationIT.java





* Fix things



* Address comments



* Import tag



* Address comments



* Make common config



* Address comments



* fix constant



* fix constant



* fix constant



* fix s



* Fix things



* Fix things



* Fix things



* Make common config



* Update README.md



* Update README.md



---------









* Add docs for usage of Jobs SDK (#1323)

* Add doc for jobs



* Add docs for Jobs



* Apply suggestions from code review




---------







* Use dapr/durabletask-java (#1336)

* microsoft durabletask-java -> dapr durabletask-java



* update another ref



* 1.5.2 release



* fix import order



* Sdk new changes



* Refine workflows



* add ;



* rm try



---------






* Update master version to 1.16.0-SNAPSHOT




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix NPE




* Fix things




* Renaming and exposing connection details (#1341)





* [Master] Fix Vulnerabilities (#1354)

* update okio



* rm unused dep



---------




* Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361)

* feat: Support for GRPC ssl



* add tests



* fix CI



* add back else if



* channel cleanup



* add root ca support



* checkstyles



* add insecure



* fix checkstyles



* use InsecureTrustManagerFactory



* fix test



---------






* Address comments




* Fix things




* Fix things




---------





















* 1.5.4 (#1375)




* fixing order Id correlation



* fixing waiting time for tests to run



* fixing app name



* adding app name and removing log lines



* Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#1379)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...





* Bump fossas/fossa-action from 1.6.0 to 1.7.0 (#1380)

Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](https://github.com/fossas/fossa-action/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: fossas/fossa-action
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...






* Fix component spec parsing (#1370)

* Fix component spec parsing



* Fix component spec parsing



* Fix component spec metadata parsing



* fix checkstyle-error



---------






* Update spring-boot-examples/workflows/README.md




* fixing comments



* Update body.json




* Update FanOutInWorkflow.java




* clean up logs for multiple executions, for standalone mode



* Update application.properties



---------


























* System Properties + Env Var Docs (#1384)

* add properties file to docs and align system properties to env var name convention with . as _



* reset env var to what it was



---------





* Updating docs to have spring boot 3.x banner and not hardcoded deps (#1366)

* updating docs to have spring boot 3.x banner and not hardcoded deps



* Update _index.md



* Update _index.md

Adding links to discord and github issues



---------





* Cleaup Test Dependencies (#1332)

* Update CONTRIBUTING.md



* Fix things



* Fix things?



* Fix logback version



* Fix logback version



* Add pom



* Add pom



* Add properties



* Added test scope



* MArk as test



* Update pom.xml



* Update pom.xml



---------







* chore: New task execution task id test (#1352)

* chore: New task execution task id test

test how taskExecutionTaskId can be used for idempotency



* chore: Clean up not used files



* docs: Task execution keys



* test: Modify unit tests



* Remove new lines



---------







* Revert "chore: New task execution task id test (#1352)" (#1389)

This reverts commit 949584f69f.




* 1.5.5 (#1390)




* Add Documentation for Conversation AI SDK (#1387)



* Cleanup Spring Dependencies (#1334)

* Update CONTRIBUTING.md



* Fix spring



* Add context



* Phase 1



* Fix things



* Fix things



* Fix spring



* Add context



* Phase 1



* Fix things



* Fix things



* move version



* Fix pom



* change version



* remove unused



* Address comments



* Fix test



* Fix test



* Fix things



---------







* Bump org.springframework:spring-context in /dapr-spring (#1394)

Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 6.1.8 to 6.1.14.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.8...v6.1.14)

---
updated-dependencies:
- dependency-name: org.springframework:spring-context
  dependency-version: 6.1.14
  dependency-type: direct:production
...





* Compensation example for Workflows (#1333)

* add basic compensation example for wf



* update commands to run + wf id



* update readme + add mechanical markdown



* fix import



* fix mechanical markdown + add how to test it locally



* move compensation example readme to workflows readme



* Update BookCarActivity.java



* Update BookFlightActivity.java



* Update BookHotelActivity.java



* Update BookTripClient.java



* Update BookTripWorker.java



* Update BookTripWorkflow.java



* Update CancelCarActivity.java



* Update CancelFlightActivity.java



* Update CancelHotelActivity.java



* add retry IT tests and catch TaskFailedException



* add test for no compensation if successful and assert attempts



* update mechanical markdown



* add back pubsub... but this should be removed long term



* try adding waitforsidecar



* rm tests from examples pr



* reset unintended changes



---------






* Adding remote endpoint request from inside activity with retry (#1388)

* adding remote endpoint request from inside activity with retry



* adding retry with Microcks payloads



* fixing review comments



* chore: New task execution task id test (#1352)

* chore: New task execution task id test

test how taskExecutionTaskId can be used for idempotency



* chore: Clean up not used files



* docs: Task execution keys



* test: Modify unit tests



* Remove new lines



---------







* Revert "chore: New task execution task id test (#1352)" (#1389)

This reverts commit 949584f69f.




* 1.5.5 (#1390)




* Add Documentation for Conversation AI SDK (#1387)



* Cleanup Spring Dependencies (#1334)

* Update CONTRIBUTING.md



* Fix spring



* Add context



* Phase 1



* Fix things



* Fix things



* Fix spring



* Add context



* Phase 1



* Fix things



* Fix things



* move version



* Fix pom



* change version



* remove unused



* Address comments



* Fix test



* Fix test



* Fix things



---------







* network is needed



---------














* Bump org.springframework:spring-context in /dapr-spring (#1398)

Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 6.1.14 to 6.1.20.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.14...v6.1.20)

---
updated-dependencies:
- dependency-name: org.springframework:spring-context
  dependency-version: 6.1.20
  dependency-type: direct:production
...





* Grouping IT tests per API surface (#1401)

* Grouping IT tests per API surface



* Fix build



---------





* Ensure OTEL version from examples aligns with SDK and ITs (#1403)



* chore: Support configuration for max grpc inbound message (#1411)




* Adding Support for Suspend / Resume Workflows (#1405)

* adding IT test



* adding initial version of suspend/resume example



* updating README



* Update README.md



* following Javi's suggestion



* fixing wrong year in headers



* fixing paths in one more README.md file



* adding output validation



* adding missing port



* fixing check conditions



---------





* Add retry handler support (#1412)

* Add retry handler support



* Wrap DurableTask objects



* Rename method



* Add isNonRetriable field to WorkflowTaskFailureDetails



* Add unit test



* Removed duplicate WorkflowFailureDetails class



* Removed unneeded when statements in retry policy unit test



* Add unit test to test both RetryPolicy and RetryHandler



* Create toRetryPolicy method



---------






* Pull out createTimer logic (#1419)

* pull out logical changes from @salaboy's PR to release it



* add missing import



---------




* Make sure there no multiple empty lines and every file ends with a new line (#1417)



* Automated Header Checks (#1416)



* Bump org.springframework:spring-web in /dapr-spring (#1424)

Bumps [org.springframework:spring-web](https://github.com/spring-projects/spring-framework) from 6.1.20 to 6.1.21.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.20...v6.1.21)

---
updated-dependencies:
- dependency-name: org.springframework:spring-web
  dependency-version: 6.1.21
  dependency-type: direct:production
...





* Aligning Spring Boot and SpringFramework versions (#1427)

* aligning versions



* letting SB to manage the logback version, so it is aligned



* removing dep from sdk-tests



* removing logback



---------




* Update pom.xml to have testcontainers 1.21.3 (#1436)




* Adding examples to Spring Boot (duration, zoneddatetime and suspend/resume) (#1413)

* implementing createtime with zoneddatetime



* adding duration and zoneddatetime examples



* using external event wf to test suspend resume



---------




* Bump org.apache.commons:commons-lang3 from 3.9 to 3.18.0 (#1446)

Bumps org.apache.commons:commons-lang3 from 3.9 to 3.18.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.18.0
  dependency-type: direct:development
...






* Update dapr docs for Hugo upgrade (#1443)





* Adds note about workflow start time (#1444)






* Migrate PubSub removing flaky test (#1407)

* Migrate PubSub removing flaky test



* Adjust assertion



* Change assert



* Apply pull request suggestions



* Use custom ObjectSerializer



---------





* supporting spring boot property for API TOKEN on workflow interceptor (#1452)




* Supporting placement and scheduler custom images (#1450)

* supporting placement and scheduler custom images



* Bump org.apache.commons:commons-lang3 from 3.9 to 3.18.0 (#1446)

Bumps org.apache.commons:commons-lang3 from 3.9 to 3.18.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.18.0
  dependency-type: direct:development
...






* Update dapr docs for Hugo upgrade (#1443)





* Adds note about workflow start time (#1444)






* adding test to validate canonical names with substitutes



* Migrate PubSub removing flaky test (#1407)

* Migrate PubSub removing flaky test



* Adjust assertion



* Change assert



* Apply pull request suggestions



* Use custom ObjectSerializer



---------





* adding tests for coverage



---------















* chore: Replace ossrh url (#1454)




* Upgrading to 1.15.7 (#1458)

* upgrading to 1.15.7



* using DAPR VERSION



---------




* updating sched api on DaprContainer (#1462)




* Adding app health check parameters (#1465)

* adding app health check parameters



* fixing style



* testing with configure for coverage



* updating sched api on DaprContainer (#1462)



* fix Artur comments



---------




* Add note about the dapr.client.* properties (#1467)




* conversation ai



* Fix pom



* Fix pom



* fix things



* Fix things



* docs: Add gRPC response settings to properties documentation (#1482)

* docs: Add gRPC response settings to properties documentation



* Apply suggestion from @javier-aliaga




---------






* Generate updated javadocs for 1.14.2




* chore: Use 1.16.0 rc 2 (#1463)

* chore: Use 1.16.0 rc



* chore: Use dapr:1.16-rc.2



* chore: Add overwrite flag to jobs



---------




* Add Failure Policy for Jobs SDK (#1448)

* Update CONTRIBUTING.md



* Ad…

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Deepak <sdeepaksharma15@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: Mason <theforbiddenai@gmail.com>
Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com>
Signed-off-by: Mirel Isaj <15373565+MyMirelHub@users.noreply.github.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Dapr Bot <daprweb@microsoft.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
Co-authored-by: iddeepak <87892182+iddeepak@users.noreply.github.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Mason <TheForbiddenAI@gmail.com>
Co-authored-by: Marc Duiker <marcduiker@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Co-authored-by: Mirel Isaj <15373565+MyMirelHub@users.noreply.github.com>
2025-09-11 17:27:30 -07:00
.github chore: Use dapr 1.16.0-rc.8 (#1552) 2025-09-10 08:16:17 -05:00
.mvn/wrapper Bump supported Spring Boot baseline to version 3.2.x (#1050) 2024-07-16 09:33:53 -07:00
dapr-spring Release 1.16.0-rc-2 2025-09-03 16:08:46 +00:00
daprdocs chore: Use dapr 1.16.0-rc.8 (#1552) 2025-09-10 08:16:17 -05:00
docs Generate updated javadocs for 1.15.0 (#1501) 2025-08-14 14:00:45 -07:00
examples Add Tool Calling to Java SDK (#1481) (#1556) 2025-09-11 17:27:30 -07:00
sdk Add Tool Calling to Java SDK (#1481) (#1556) 2025-09-11 17:27:30 -07:00
sdk-actors Release 1.16.0-rc-2 2025-09-03 16:08:46 +00:00
sdk-autogen Release 1.16.0-rc-2 2025-09-03 16:08:46 +00:00
sdk-springboot Release 1.16.0-rc-2 2025-09-03 16:08:46 +00:00
sdk-tests Add Tool Calling to Java SDK (#1481) (#1556) 2025-09-11 17:27:30 -07:00
sdk-workflows Release 1.16.0-rc-2 2025-09-03 16:08:46 +00:00
spring-boot-examples chore: Use dapr 1.16.0-rc.8 (#1552) 2025-09-10 08:16:17 -05:00
testcontainers-dapr chore: Use dapr 1.16.0-rc.8 (#1552) 2025-09-10 08:16:17 -05:00
.codecov.yaml Update state, secrets examples. Fix state toString. Ignore sdk-autogen in code coverage. (#340) 2020-09-21 15:06:46 -07:00
.gitignore Change "127.0.0.1" to SIDECAR_IP to dynamically account for IPv4 vs. IPv6 environments (#649) 2024-02-20 07:55:27 -08:00
.gitmodules Renames project to . Fixes examples. Adds proto files from release-0.3. 2019-12-05 18:30:13 -08:00
.java_header Config api support (#670) 2022-01-12 16:01:13 -08:00
.sdkmanrc Bump supported Spring Boot baseline to version 3.2.x (#1050) 2024-07-16 09:33:53 -07:00
CODEOWNERS Update CODEOWNERS (#571) 2021-07-02 18:38:35 -07:00
CONTRIBUTING.md Compensation example for Workflows (#1333) 2025-05-29 14:54:50 -05:00
LICENSE Update LICENSE to Apache 2.0 (#657) 2021-12-09 20:15:47 +05:30
README.md Generate updated javadocs for 1.15.0 (#1501) 2025-08-14 14:00:45 -07:00
checkstyle.xml Automated Header Checks (#1416) 2025-06-13 00:39:29 +03:00
mvnw Bump supported Spring Boot baseline to version 3.2.x (#1050) 2024-07-16 09:33:53 -07:00
mvnw.cmd Bump supported Spring Boot baseline to version 3.2.x (#1050) 2024-07-16 09:33:53 -07:00
pom.xml chore: Use dapr 1.16.0-rc.8 (#1552) 2025-09-10 08:16:17 -05:00
settings.xml Java SDK with all features implemented for milestone 0.4 (#154) 2020-01-24 12:49:56 -08:00
spotbugs-exclude.xml Add JDK17 and springboot 3.0 support (#975) 2024-01-15 08:30:35 -08:00

README.md

Dapr SDK for Java

Maven Central GitHub Actions Workflow Status codecov GitHub License FOSSA Status GitHub issue custom search in repo Discord YouTube Channel Views X (formerly Twitter) Follow

This is the Dapr SDK for Java, including the following features:

  • PubSub
  • Service Invocation
  • Binding
  • State Store
  • Actors
  • Workflows

Getting Started

Pre-Requisites

Install JDK

If using SDKMAN!, execute sdk env install to install the required JDK.

Importing Dapr's Java SDK

For a Maven project, add the following to your pom.xml file:

<project>
  ...
  <dependencies>
    ...
     <!-- Dapr's core SDK with all features, except Actors. -->
    <dependency>
      <groupId>io.dapr</groupId>
      <artifactId>dapr-sdk</artifactId>
      <version>1.15.0</version>
    </dependency>
    <!-- Dapr's SDK for Actors (optional). -->
    <dependency>
      <groupId>io.dapr</groupId>
      <artifactId>dapr-sdk-actors</artifactId>
      <version>1.15.0</version>
    </dependency>
    <!-- Dapr's SDK integration with SpringBoot (optional). -->
    <dependency>
      <groupId>io.dapr</groupId>
      <artifactId>dapr-sdk-springboot</artifactId>
      <version>1.15.0</version>
    </dependency>
    ...
  </dependencies>
  ...
</project>

For a Gradle project, add the following to your build.gradle file:

dependencies {
...
    // Dapr's core SDK with all features, except Actors.
    compile('io.dapr:dapr-sdk:1.15.0')
    // Dapr's SDK for Actors (optional).
    compile('io.dapr:dapr-sdk-actors:1.15.0')
    // Dapr's SDK integration with SpringBoot (optional).
    compile('io.dapr:dapr-sdk-springboot:1.15.0')
}

Running the examples

Clone this repository including the submodules:

git clone https://github.com/dapr/java-sdk.git

Then head over to build the Maven (Apache Maven version 3.x) project:

# make sure you are in the `java-sdk` directory.
./mvnw clean install

Try the following examples to learn more about Dapr's Java SDK:

Running Spring Boot examples

The Spring Boot integration for Dapr use Testcontainers to set up a local environment development flow that doesn't require the use of the dapr CLI and it integrates with the Spring Boot programming model.

You can find a step-by-step tutorial showing this integration here.

API Documentation

Please, refer to our Javadoc website.

Reactor API

The Java SDK for Dapr is built using Project Reactor. It provides an asynchronous API for Java. A result is consumed synchronously by using the block() method, as shown in the examples referenced above.

The code below does not make any API call, it simply returns the Mono publisher object. Nothing happens until the application subscribes or blocks on the result:

Mono<Void> result = daprClient.publishEvent("mytopic", "my message");

To start execution and receive the result object synchronously (void or Void becomes an empty result), use block(). The code below shows how to execute the call and consume an empty response:

Mono<Void> result = daprClient.publishEvent("mytopic", "my message");
result.block();

How to use a custom serializer

This SDK provides a basic serialization for request/response objects, and state objects. Applications should provide their own serialization for production scenarios.

  1. Implement the DaprObjectSerializer interface. See this class as an example.
  2. Use your serializer class in the following scenarios:
    DaprClient client = (new DaprClientBuilder())
        .withObjectSerializer(new MyObjectSerializer()) // for request/response objects.
        .withStateSerializer(new MyStateSerializer()) // for state objects.
        .build();
    
    • When registering an Actor Type:
    ActorRuntime.getInstance().registerActor(
      DemoActorImpl.class,
      new MyObjectSerializer(), // for request/response objects.
      new MyStateSerializer()); // for state objects.
    
    • When building a new instance of ActorProxy to invoke an Actor instance, use the same serializer as when registering the Actor Type:
    try (ActorClient actorClient = new ActorClient()) {
      DemoActor actor = (new ActorProxyBuilder(DemoActor.class, actorClient))
          .withObjectSerializer(new MyObjectSerializer()) // for request/response objects.
          .build(new ActorId("100"));
    }
    

Debug a Java application or Dapr's Java SDK

In IntelliJ Community Edition, consider debugging in IntelliJ.

In Visual Studio Code, consider debugging in Visual Studio Code.

If you need to debug your Application, run the Dapr sidecar separately, and then start the application from your IDE (IntelliJ or Eclipse, for example). For Linux and MacOS:

dapr run --app-id testapp --app-port 3000 --dapr-http-port 3500 --dapr-grpc-port 5001

Note: confirm the correct port that the app will listen to and that the Dapr ports above are free, changing the ports if necessary.

When running your Java application from your IDE, make sure the following environment variables are set, so the Java SDK knows how to connect to Dapr's sidecar:

DAPR_HTTP_PORT=3500
DAPR_GRPC_PORT=5001

Now you can go to your IDE and debug your Java application, using port 3500 to call Dapr while also listening to port 3000 to expose Dapr's callback endpoint.

Exception handling

Most exceptions thrown from the SDK are instances of DaprException. DaprException extends from RuntimeException, making it compatible with Project Reactor. See the exception example for more details.

Development

Update URL to fetch proto files

Change the dapr.proto.baseurl property below in 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.

Note: You may need to run ./mvnw clean after changing this setting to remove any auto-generated files so that the new proto files get downloaded and compiled.

<project>
  ...
  <properties>
    ...
    <!-- change this .... -->
    <dapr.proto.baseurl>https://raw.githubusercontent.com/dapr/dapr/(current ref in pom.xml)/dapr/proto</dapr.proto.baseurl>
    <!-- to something like this: -->
    <dapr.proto.baseurl>https://raw.githubusercontent.com/dapr/dapr/1ac5d0e8590a7d6772c9957c236351ed992ccb19/dapr/proto</dapr.proto.baseurl>
    ...
  </properties>
  ...
</project>

Running Integration Tests (ITs)

Pre-Requisites

Code

The code for the tests are present inside the project sdk-tests. This module alone can be imported as a separate project in IDEs. This project depends on the rest of the JARs built by the other modules in the repo like sdk, sdk-springboot etc.

As a starting point for running the Integration Tests, first run ./mvnw clean install from the root of the repo to build the JARs for the different modules, except the sdk-tests module.

Run all the dependent services spun up during build

During normal CI build, docker compose is used to bring up services like MongoDB, Hashicorp Vault, Apache Zookeeper, Kafka etc.

Similarly, all of these need to be run for running the ITs either individually or as a whole.

Run the following commands from the root of the repo to start all the docker containers that the tests depend on.

docker compose -f ./sdk-tests/deploy/local-test.yml up -d

To stop the containers and services, run the following commands.

docker compose -f ./sdk-tests/deploy/local-test.yml down

Run all ITs from command line

From the java-sdk repo root, change to the sdk-tests directory and run the following command.

## with current directory as /java-sdk/sdk-tests/

../mvnw clean install

The above command runs all the integration tests present in the sdk-tests project.

Run Individual tests from IntelliJ

In IntelliJ, go to File > New > Project from Existing Sources.... Import the sdk-tests project.

Once the project has been imported, the individual tests can be run normally as any Unit Tests, from the IDE itself.

intellij-integration-test.

Sometimes when the sdk-tests project does not build correctly, try File > Invalidate Caches... and try restarting IntelliJ.

You should be able to set breakpoints and Debug the test directly from IntelliJ itself as seen from the above image.