Compare commits

...

310 Commits

Author SHA1 Message Date
Siri Varma Vegiraju 7cf6533afd
Automated Header Checks (#1416) 2025-06-13 00:39:29 +03:00
Siri Varma Vegiraju 2454fec841
Make sure there no multiple empty lines and every file ends with a new line (#1417) 2025-06-12 18:00:01 +03:00
Cassie Coyle e3fc48d4eb
Pull out createTimer logic (#1419)
* pull out logical changes from @salaboy's PR to release it

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add missing import

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-06-11 15:11:58 -05:00
Mason 981b3b457b
Add retry handler support (#1412)
* Add retry handler support

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Wrap DurableTask objects

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Rename method

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Add isNonRetriable field to WorkflowTaskFailureDetails

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Add unit test

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Removed duplicate WorkflowFailureDetails class

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Removed unneeded when statements in retry policy unit test

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Add unit test to test both RetryPolicy and RetryHandler

Signed-off-by: Mason <theforbiddenai@gmail.com>

* Create toRetryPolicy method

Signed-off-by: Mason <theforbiddenai@gmail.com>

---------

Signed-off-by: Mason <theforbiddenai@gmail.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-06-11 13:31:28 -05:00
salaboy dcaca773b3
Adding Support for Suspend / Resume Workflows (#1405)
* adding IT test

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding initial version of suspend/resume example

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating README

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update README.md

Signed-off-by: salaboy <Salaboy@gmail.com>

* following Javi's suggestion

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing wrong year in headers

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing paths in one more README.md file

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding output validation

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding missing port

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing check conditions

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-06-11 09:52:29 -05:00
Javier Aliaga e13f934efe
chore: Support configuration for max grpc inbound message (#1411)
Signed-off-by: Javier Aliaga <javier@diagrid.io>
2025-06-10 16:05:42 -05:00
artur-ciocanu 3a8fd611da
Ensure OTEL version from examples aligns with SDK and ITs (#1403) 2025-06-05 23:35:49 +03:00
artur-ciocanu 7e2f81d0e3
Grouping IT tests per API surface (#1401)
* Grouping IT tests per API surface

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix build

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-06-04 17:02:13 -07:00
dependabot[bot] 13a973bf5a
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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-02 21:37:53 -07:00
salaboy 447e2bfa86
Adding remote endpoint request from inside activity with retry (#1388)
* adding remote endpoint request from inside activity with retry

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding retry with Microcks payloads

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing review comments

Signed-off-by: salaboy <Salaboy@gmail.com>

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

* chore: New task execution task id test

test how taskExecutionTaskId can be used for idempotency

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Clean up not used files

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* docs: Task execution keys

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* test: Modify unit tests

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* Remove new lines

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

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

This reverts commit 949584f69f.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* 1.5.5 (#1390)

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Add Documentation for Conversation AI SDK (#1387)

Signed-off-by: salaboy <Salaboy@gmail.com>

* Cleanup Spring Dependencies (#1334)

* Update CONTRIBUTING.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Fix spring

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add context

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Phase 1

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix spring

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add context

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Phase 1

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* move version

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* change version

Signed-off-by: sirivarma <siri.varma@outlook.com>

* remove unused

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix test

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix test

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* network is needed

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
2025-05-30 18:28:18 -07:00
Cassie Coyle 114e354363
Compensation example for Workflows (#1333)
* add basic compensation example for wf

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update commands to run + wf id

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update readme + add mechanical markdown

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix import

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix mechanical markdown + add how to test it locally

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* move compensation example readme to workflows readme

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update BookCarActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update BookFlightActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update BookHotelActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update BookTripClient.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update BookTripWorker.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update BookTripWorkflow.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update CancelCarActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update CancelFlightActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update CancelHotelActivity.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* add retry IT tests and catch TaskFailedException

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add test for no compensation if successful and assert attempts

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update mechanical markdown

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

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

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try adding waitforsidecar

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm tests from examples pr

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* reset unintended changes

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-29 14:54:50 -05:00
dependabot[bot] 1852cc5590
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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-29 10:28:55 -05:00
Siri Varma Vegiraju c466d1b743
Cleanup Spring Dependencies (#1334)
* Update CONTRIBUTING.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Fix spring

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add context

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Phase 1

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix spring

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add context

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Phase 1

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* move version

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* change version

Signed-off-by: sirivarma <siri.varma@outlook.com>

* remove unused

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix test

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix test

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-28 21:37:23 -07:00
Siri Varma Vegiraju e6f7c6eb06
Add Documentation for Conversation AI SDK (#1387) 2025-05-29 06:55:29 +03:00
Cassie Coyle 6cecd76745
1.5.5 (#1390)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-05-28 15:01:04 -05:00
Javier Aliaga ba3b529830
Revert "chore: New task execution task id test (#1352)" (#1389)
This reverts commit 949584f69f.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
2025-05-28 13:14:59 -05:00
Javier Aliaga 949584f69f
chore: New task execution task id test (#1352)
* chore: New task execution task id test

test how taskExecutionTaskId can be used for idempotency

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Clean up not used files

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* docs: Task execution keys

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* test: Modify unit tests

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* Remove new lines

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-28 09:43:48 -05:00
Siri Varma Vegiraju a99d286a88
Cleaup Test Dependencies (#1332)
* Update CONTRIBUTING.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Fix things

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things?

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix logback version

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix logback version

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add pom

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add pom

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add properties

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Added test scope

Signed-off-by: siri-varma <siri.varma@outlook.com>

* MArk as test

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update pom.xml

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update pom.xml

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-23 11:38:31 -07:00
salaboy 8ea5ea4f4b
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

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update _index.md

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update _index.md

Adding links to discord and github issues

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-22 16:55:54 -05:00
Cassie Coyle 7291d4c74d
System Properties + Env Var Docs (#1384)
* add properties file to docs and align system properties to env var name convention with . as _

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* reset env var to what it was

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-21 15:00:47 -07:00
salaboy 1e4bcf9b9f
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

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* add tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add back else if

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* channel cleanup

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add root ca support

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add insecure

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use InsecureTrustManagerFactory

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* spring boot workflow patterns initial version

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding README for workflows

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding child example

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating examples to work with markdown tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* running mechanical markdown for workflow examples

Signed-off-by: salaboy <Salaboy@gmail.com>

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

* Add coverage for some properties (#1297)

Signed-off-by: sirivarma <siri.varma@outlook.com>

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

Signed-off-by: sirivarma <siri.varma@outlook.com>

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

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* Use Java Bean for connection details and add more tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify mock setup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adding even more tests for test coverage

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Update CONTRIBUTING.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* 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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix URL building logic (#1320)

* Fix URL building logic

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add test for query params

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix the assertion in the test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Remove uneeded changes from IT test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify the testing a little bit

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the test to use ServerRequest

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Test removing things from method invoke controller

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add query param encoding test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some tiny styles

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Generate updated javadocs for 1.14.1

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add Conversation AI to Java SDK (#1235)

* Conversation first commit

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add unit tests

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* change ai to conv

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Move to single module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Remove module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add Integration tests

Signed-off-by: siri-varma <siri.varma@outlook.com>

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

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Import tag

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix s

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* Add doc for jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add docs for Jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Apply suggestions from code review

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Use dapr/durabletask-java (#1336)

* microsoft durabletask-java -> dapr durabletask-java

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update another ref

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* 1.5.2 release

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix import order

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Sdk new changes

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Refine workflows

Signed-off-by: siri-varma <siri.varma@outlook.com>

* add ;

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm try

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Update master version to 1.16.0-SNAPSHOT

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Renaming and exposing connection details (#1341)

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* [Master] Fix Vulnerabilities (#1354)

* update okio

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm unused dep

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* feat: Support for GRPC ssl

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* add tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add back else if

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* channel cleanup

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add root ca support

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add insecure

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use InsecureTrustManagerFactory

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Artur Ciocanu <ciocanu@adobe.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>
Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
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: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* 1.5.4 (#1375)

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing order Id correlation

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing waiting time for tests to run

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing app name

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding app name and removing log lines

Signed-off-by: salaboy <Salaboy@gmail.com>

* 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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* 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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Fix component spec parsing (#1370)

* Fix component spec parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* Fix component spec parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* Fix component spec metadata parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* fix checkstyle-error

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

---------

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

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

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing comments

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update body.json

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update FanOutInWorkflow.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* clean up logs for multiple executions, for standalone mode

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update application.properties

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Artur Ciocanu <ciocanu@adobe.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: Deepak <sdeepaksharma15@gmail.com>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
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: iddeepak <87892182+iddeepak@users.noreply.github.com>
2025-05-21 14:56:55 -05:00
iddeepak c3592b446d
Fix : Typo in code comments (#1381)
* Fix Typo in Comments

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* Update review comments

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

---------

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-21 09:01:09 -07:00
Javier Aliaga e84d2c4e61
chore: Add grpc keepalives (#1382)
* chore: Add grpc keepalives

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Make grpc keepalive configurable

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Fix review comments

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Missing keepalive config for GRPC TLS INSECURE

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* chore: Add test

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* fix: Comment typo

Signed-off-by: Javier Aliaga <javier@diagrid.io>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
2025-05-21 09:53:15 -05:00
iddeepak e4cc0303fa
Fix component spec parsing (#1370)
* Fix component spec parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* Fix component spec parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* Fix component spec metadata parsing

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

* fix checkstyle-error

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>

---------

Signed-off-by: Deepak <sdeepaksharma15@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-05-19 16:32:09 -07:00
dependabot[bot] c07e07b782
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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-05-19 13:34:07 -07:00
dependabot[bot] a1ec3ce898
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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 14:22:22 -05:00
Cassie Coyle 910b13ba56
1.5.4 (#1375)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-05-15 19:04:41 -05:00
Siri Varma Vegiraju 824f357f58
Fix the issue with retries not happening correctly for Activities and Workflows (#1343)
* Add coverage for some properties (#1297)

Signed-off-by: sirivarma <siri.varma@outlook.com>

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

Signed-off-by: sirivarma <siri.varma@outlook.com>

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

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* Use Java Bean for connection details and add more tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify mock setup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adding even more tests for test coverage

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Update CONTRIBUTING.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* 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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix URL building logic (#1320)

* Fix URL building logic

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add test for query params

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix the assertion in the test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Remove uneeded changes from IT test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify the testing a little bit

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the test to use ServerRequest

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Test removing things from method invoke controller

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add query param encoding test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some tiny styles

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Generate updated javadocs for 1.14.1

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add Conversation AI to Java SDK (#1235)

* Conversation first commit

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add unit tests

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* change ai to conv

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Move to single module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Remove module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add Integration tests

Signed-off-by: siri-varma <siri.varma@outlook.com>

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

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Import tag

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix s

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* Add doc for jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add docs for Jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Apply suggestions from code review

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Use dapr/durabletask-java (#1336)

* microsoft durabletask-java -> dapr durabletask-java

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update another ref

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* 1.5.2 release

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix import order

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Sdk new changes

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Refine workflows

Signed-off-by: siri-varma <siri.varma@outlook.com>

* add ;

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm try

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Update master version to 1.16.0-SNAPSHOT

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix NPE

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Renaming and exposing connection details (#1341)

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* [Master] Fix Vulnerabilities (#1354)

* update okio

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm unused dep

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

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

* feat: Support for GRPC ssl

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* add tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add back else if

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* channel cleanup

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add root ca support

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add insecure

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use InsecureTrustManagerFactory

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Artur Ciocanu <ciocanu@adobe.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>
Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
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: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
2025-05-15 18:27:00 -05:00
Cassie Coyle daf4c8b703
Feat Add TLS & mTLS support for gRPC with root CA and insecure mode (#1361)
* feat: Support for GRPC ssl

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* add tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add back else if

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* channel cleanup

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add root ca support

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add insecure

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix checkstyles

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use InsecureTrustManagerFactory

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
2025-05-14 16:58:40 -05:00
Cassie Coyle 551d205b1d
[Master] Fix Vulnerabilities (#1354)
* update okio

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm unused dep

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-05-13 16:42:44 -05:00
artur-ciocanu 4e1fbbe2ce
Renaming and exposing connection details (#1341)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-05-13 09:35:10 -05:00
Dapr Bot ab8e41111d Update master version to 1.16.0-SNAPSHOT
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
2025-05-08 18:32:56 +00:00
Cassie Coyle 7ed4d9184c
Use dapr/durabletask-java (#1336)
* microsoft durabletask-java -> dapr durabletask-java

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update another ref

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* 1.5.2 release

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix import order

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Sdk new changes

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Refine workflows

Signed-off-by: siri-varma <siri.varma@outlook.com>

* add ;

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm try

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: siri-varma <siri.varma@outlook.com>
2025-05-08 12:48:53 -05:00
Siri Varma Vegiraju ecc94f5b94
Add docs for usage of Jobs SDK (#1323)
* Add doc for jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add docs for Jobs

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Apply suggestions from code review

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-05-06 13:41:09 -05:00
Siri Varma Vegiraju dcf2d3e359
Update CONTRIBUTING.md (#1327)
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
2025-05-06 18:39:48 +03:00
Siri Varma Vegiraju 99e21db465
Add Conversation AI to Java SDK (#1235)
* Conversation first commit

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add unit tests

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* change ai to conv

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Move to single module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Remove module

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add Integration tests

Signed-off-by: siri-varma <siri.varma@outlook.com>

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

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Import tag

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Address comments

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix constant

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix s

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Make common config

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-05-01 14:11:03 -05:00
Dapr Bot c53f000ef2 Generate updated javadocs for 1.14.1
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
2025-04-30 14:01:29 +00:00
artur-ciocanu b7e45a06c1
Fix URL building logic (#1320)
* Fix URL building logic

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add test for query params

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix the assertion in the test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Remove uneeded changes from IT test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify the testing a little bit

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust the test to use ServerRequest

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Test removing things from method invoke controller

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add query param encoding test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert some unintended changes

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some tiny styles

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-04-29 12:06:05 -05:00
dependabot[bot] 80c3a6d122
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
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2025-04-22 15:34:31 -07:00
artur-ciocanu de2dc63389
Use Java Bean for connection details and add more tests (#1317)
* Use Java Bean for connection details and add more tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify mock setup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adding even more tests for test coverage

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-04-22 14:00:42 -07:00
artur-ciocanu 67c5991697
Separate Dapr constants from IT container constants (#1315)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-04-22 13:09:48 -05:00
Siri Varma Vegiraju 8b8684a2db
Make the DAPR version being used consistent across all tests (#1299) 2025-04-19 01:59:56 +03:00
Matheus Cruz 9b635dae6d
Add coverage for some properties (#1297) 2025-04-16 21:19:46 +03:00
Siri Varma Vegiraju ed9a3fb77b
Add the Jobs SDK (#1255)
* Add jobs

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add validations

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add things

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add things

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove builder and change to setter

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove module

Signed-off-by: sirivarma <siri.varma@outlook.com>

* remove jobs

Signed-off-by: sirivarma <siri.varma@outlook.com>

* change bean name

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Use latest Dapr release

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix comments and fix tests

Signed-off-by: siri-varma <siri.varma@outlook.com>

* remove *

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fix conflicts

Signed-off-by: siri-varma <siri.varma@outlook.com>

* remove space

Signed-off-by: siri-varma <siri.varma@outlook.com>

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

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update testcontainers-dapr/src/main/java/io/dapr/testcontainers/DaprContainer.java

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Add comment

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update DaprPreviewClientGrpcTest.java

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update DaprPreviewClientGrpcTest.java

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Fix spaces

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix spaces

Signed-off-by: siri-varma <siri.varma@outlook.com>

* fixt hings

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Add examples

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Cleanup

Signed-off-by: siri-varma <siri.varma@outlook.com>

* indent to spaces

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update README.md

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update DemoJobsClient.java

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update DaprClientImpl.java

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

* Update DaprClientImpl.java

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-04-16 11:15:14 -05:00
artur-ciocanu 128cfdeb4b
Removing OkHttp3 dependencies (#1313)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-04-14 17:44:49 -05:00
artur-ciocanu ef1fc2242a
Ensure DurableTask classes are hidden in Workflow Runtime package (#1311)
* Ensure DurableTask classes are hidden in Workflow Runtime package

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix the file header

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-04-14 11:36:21 -05:00
Matheus Cruz 8cb80997cf
Remove flaky test using Testcontainers and a more specific test approach (#1288)
* Remove flaky test using Testcontainers and a more specific test approach

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>

* Add license header

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>

---------

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
2025-04-07 17:17:19 -05:00
Joe Bowbeer 0572e244cb
fix: typos in _index.md (#1293)
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
2025-04-01 11:45:28 -05:00
seal90 02733dcc15
Fix the warn log issue caused by not setting the dapr.client.grpcPort variable (#1289)
Signed-off-by: seal90 <578935869@qq.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-31 13:26:40 -05:00
Matheus Cruz 505b93acb5
Add checkstyle info on CONTRIBUTING.md (#1290)
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-03-31 12:26:28 -05:00
Cassie Coyle bc2b04f24b
add link to community repo (#1287)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-03-27 13:57:15 -05:00
salaboy de82451a38
Support App HTTP middleware Pipelines (#1271)
* supporting appHttpPipelines for middleware

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding test with inline string

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing checkstyle

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding license hearders and TODO references

Signed-off-by: salaboy <Salaboy@gmail.com>

* Move dependency management and plugin management to parent pom (#1260)

* Clean up pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* downgrade dependency

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix thigns

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix class not found

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove import

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* upgrade test containers to .5

Signed-off-by: sirivarma <siri.varma@outlook.com>

* This is it

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix feedback

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Change to properties

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update docker version for CI to fix flaky tests (#1276)

* update docker version for ci

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding DOCKER_HOST to all tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* Move dependency management and plugin management to parent pom (#1260)

* Clean up pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* downgrade dependency

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix thigns

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix class not found

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove import

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* upgrade test containers to .5

Signed-off-by: sirivarma <siri.varma@outlook.com>

* This is it

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix feedback

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Change to properties

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing flaky docker network

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Change CountWordsAcitivy output format due to clashing (#1279)

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Bump codecov/codecov-action from 4.4.1 to 5.4.0 (#1278)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 5.4.0.
- [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/v4.4.1...v5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Bump fossas/fossa-action from 1.3.3 to 1.6.0 (#1277)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* update instructions to cover podman (#1274)

Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* following checkstyle

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-27 12:14:49 -05:00
salaboy f0c35968f4
update instructions to cover podman (#1274)
Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-27 11:17:03 -05:00
dependabot[bot] c909d26811
Bump fossas/fossa-action from 1.3.3 to 1.6.0 (#1277)
Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.3.3 to 1.6.0.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](https://github.com/fossas/fossa-action/compare/v1.3.3...v1.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-25 15:44:57 -05:00
dependabot[bot] 58b7f256a3
Bump codecov/codecov-action from 4.4.1 to 5.4.0 (#1278)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 5.4.0.
- [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/v4.4.1...v5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-25 14:41:23 -05:00
Matheus Cruz 16f9da0c4b
Change CountWordsAcitivy output format due to clashing (#1279)
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-25 09:17:13 -05:00
salaboy 7990ed79ec
Update docker version for CI to fix flaky tests (#1276)
* update docker version for ci

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding DOCKER_HOST to all tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* Move dependency management and plugin management to parent pom (#1260)

* Clean up pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* downgrade dependency

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix thigns

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix class not found

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove import

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* upgrade test containers to .5

Signed-off-by: sirivarma <siri.varma@outlook.com>

* This is it

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix feedback

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Change to properties

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing flaky docker network

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-25 08:38:36 -05:00
Siri Varma Vegiraju 7b82d7336b
Move dependency management and plugin management to parent pom (#1260)
* Clean up pom

Signed-off-by: sirivarma <siri.varma@outlook.com>

* downgrade dependency

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix thigns

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix class not found

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Remove import

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Address comments

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* cleanup

Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix deps

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix things

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* Fix finals

Signed-off-by: siri-varma <siri.varma@outlook.com>

* upgrade test containers to .5

Signed-off-by: sirivarma <siri.varma@outlook.com>

* This is it

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Fix feedback

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Add comment

Signed-off-by: sirivarma <siri.varma@outlook.com>

* Change to properties

Signed-off-by: sirivarma <siri.varma@outlook.com>

---------

Signed-off-by: sirivarma <siri.varma@outlook.com>
Signed-off-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Signed-off-by: siri-varma <siri.varma@outlook.com>
Co-authored-by: Siri Varma Vegiraju <svegiraju@microsoft.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-24 12:06:08 -05:00
dependabot[bot] 57f6b96d60
Bump codecov/codecov-action from 4.1.0 to 4.4.1 (#1047)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.0 to 4.4.1.
- [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/v4.1.0...v4.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
2025-03-20 15:50:12 -05:00
Shubhdeep Singh c1ee14100b
Improvement of dapr-doc (#1084)
* Update java-contributing.md

Signed-off-by: Shubhdeep Singh <shubhdeepsingh1502@gmail.com>

* Update CONTRIBUTING.md

Signed-off-by: Shubhdeep Singh <shubhdeepsingh1502@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update daprdocs/content/en/java-sdk-contributing/java-contributing.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: Shubhdeep Singh <shubhdeepsingh1502@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2025-03-20 15:11:45 -05:00
Matheus Cruz ffbb5b39bd
Add JavaTimeModule (#1065)
* Allow customize ObjectSerializer using a custom ObjectMapper

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>

* Apply pull request suggestions

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>

---------

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
2025-03-20 14:15:52 -05:00
Dapr Bot 42b2d88216 Generate updated javadocs for 1.14.0
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
2025-03-19 20:32:41 +00:00
salaboy e2a944eea6
Update build.yml (#1265)
Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-18 15:32:08 -05:00
Cassie Coyle 5ebc5e359e
update commons-cli -> 1.9.0 (#1206)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-03-17 13:40:23 -05:00
salaboy 19c662cc2d
adding missing reuse to tests (#1262)
Signed-off-by: salaboy <Salaboy@gmail.com>
2025-03-17 09:36:52 -05:00
Cassie Coyle a03f22064e
Update dapr v1.15 (#1242)
* update to 15.2 to fix release builds

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* 1.15.3

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-03-14 12:26:07 -05:00
salaboy bb48276691
Cherry-picking timeout and nexus URL from release 1.14 to master (#1257)
* fixing argument order for deploy profile option (#1250)

Signed-off-by: salaboy <Salaboy@gmail.com>

* up build timeout (#1256)

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Setting nexus URL  (#1254)

* adding nexus url

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing duplicate dep

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding missing version, which is not needed but to avoid warn

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-03-13 08:15:53 -05:00
salaboy 18a036c193
using nexus staging plugig to deploy and skip deploys (#1252)
Signed-off-by: salaboy <Salaboy@gmail.com>
2025-03-11 12:30:59 -05:00
salaboy c9b013f0c1
fixing argument order for deploy profile option (#1250)
Signed-off-by: salaboy <Salaboy@gmail.com>
2025-03-11 08:55:51 -05:00
salaboy 641b34a107
fixing deploy skip (#1246)
Signed-off-by: salaboy <Salaboy@gmail.com>
2025-03-10 15:36:06 -05:00
Cassie Coyle ff917acf4f
Consolidate SpringBoot Versions & Fix Release Pipeline (#1239)
* fix release

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* remove springboot v3.2.6 and use dapr-sdk-parent version

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-03-07 13:07:02 -06:00
Cassie Coyle 465c9e0a8d
fix orphaned channel (#1241)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2025-03-07 12:28:42 -06:00
Artur Souza ad917d215b
DaprBot pushing tag or to branch already triggers build. (#1238)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-06 21:56:03 -06:00
Artur Souza ed95feeaf4
Remove duplicate workflow build for pushes to master branch. (#1237)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-06 12:10:34 -08:00
salaboy 247502a1b1
do we need this? (#1234)
Signed-off-by: salaboy <Salaboy@gmail.com>
2025-03-06 11:13:56 -06:00
Dapr Bot d6c14dee69 Update master version to 1.15.0-SNAPSHOT
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
2025-03-05 18:09:15 +00:00
Artur Souza 54f3997bd1
Fix create release script. (#1233)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-05 10:52:43 -06:00
Artur Souza 7994fe8997
Use Dapr Bot token when checking out code. (#1232)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-04 21:42:02 -08:00
Artur Souza 5eed6953a1
No PR needed for bot changes when releasing + release trigger fix (#1227)
* No PR needed for bot changes when releasing.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix build trigger for release.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-04 14:52:10 -08:00
Artur Souza 6108547fc2
Restrict deploy to a subset of artifacts (#1228)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-03-04 14:36:33 -08:00
salaboy 36a0140398
Upgrading spring boot version to 3.4.3 (#1220)
* upgrading spring boot version to 3.4.3

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing sb 3.2.x

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing label

Signed-off-by: salaboy <Salaboy@gmail.com>

* using 3.3.9 to validate against sb 3.3.x

Signed-off-by: salaboy <Salaboy@gmail.com>

* found the issue with the version

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing toxic dep from classpath

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing excludes

Signed-off-by: salaboy <Salaboy@gmail.com>

* upgrading otel and logback

Signed-off-by: salaboy <Salaboy@gmail.com>

* waiting for Dapr to be done with init

Signed-off-by: salaboy <Salaboy@gmail.com>

* waiting for placement

Signed-off-by: salaboy <Salaboy@gmail.com>

* using awaitability to wait for placement

Signed-off-by: salaboy <Salaboy@gmail.com>

* waiting for placement, but still flaky

Signed-off-by: salaboy <Salaboy@gmail.com>

* wait for app to be ready

Signed-off-by: salaboy <Salaboy@gmail.com>

* test with 1.14.4

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update DaprContainerIT.java

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
2025-03-03 10:35:06 -08:00
Christian Kaps efce229985
Add actor testcontainer tests (#1192)
* Add actor testcontainer tests

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* adding auto config

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* updating ActorClient

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* registering?

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* updating actors test and actorruntime

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* updating ActorRuntime

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Adding WorkflowTaskOptions and use it instead of TaskOptions (#1200)

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Fix formatting issues

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* adding spring boot workflows integration (#1195)

Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Register workflows and acitivities using instances along classes (#1201)

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* feat: Adding basic HTTPEndpoint configuration support in testcontainers module (#1210)

* feat: Adding basic HTTPEndpoint configuration support in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

* feat: #1209 Adding test for HTTPEndpoint in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

---------

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* fixing actors IT test and messaging IT with app-health-checks

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Add app health check support to Dapr Testcontainer (#1213)

* Add app health check support to Dapr Testcontainer

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some minor cleanup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move waiting to beforeEach, it looks more natural

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* adding license headers + adding wait for actors in test

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Add app health check support to Dapr Testcontainer (#1213)

* Add app health check support to Dapr Testcontainer

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some minor cleanup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move waiting to beforeEach, it looks more natural

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Picks a port for DaprActorITS for test containers to avoid conflict.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Add app health check support to Dapr Testcontainer (#1213)

* Add app health check support to Dapr Testcontainer

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some minor cleanup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move waiting to beforeEach, it looks more natural

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* using random port thanks to @artur-ciocanu

Signed-off-by: Christian Kaps <ck-github@mohiva.com>

* Update TestRestController.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update DaprActorsIT.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

* Update DaprContainer.java

Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>

---------

Signed-off-by: Christian Kaps <ck-github@mohiva.com>
Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: salaboy <Salaboy@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2025-03-01 10:00:52 -08:00
salaboy 5dbeafc24a
Adding producer and consumer app examples for Spring Boot integration (#1208)
* adding spring boot producer

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding consumer app

Signed-off-by: salaboy <Salaboy@gmail.com>

* increasing wait for events to popup

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding readme and examples

Signed-off-by: salaboy <Salaboy@gmail.com>

* aligning tests for examples

Signed-off-by: salaboy <Salaboy@gmail.com>

* increasing time out

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding health check from the sidecar

Signed-off-by: salaboy <Salaboy@gmail.com>

* feat: Adding basic HTTPEndpoint configuration support in testcontainers module (#1210)

* feat: Adding basic HTTPEndpoint configuration support in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

* feat: #1209 Adding test for HTTPEndpoint in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

---------

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* updating example

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing example

Signed-off-by: salaboy <Salaboy@gmail.com>

* Add app health check support to Dapr Testcontainer (#1213)

* Add app health check support to Dapr Testcontainer

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some minor cleanup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move waiting to beforeEach, it looks more natural

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* commenting reuse

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding how to run on Kubernetes, unfortunately we need to create containers

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing subscription and fixing scopes

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding license headers and logger

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating logs

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating READMEs and update_sdk_version for new module

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing old line

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing sleeps, using Wait

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating Kubernetes tutorial to use local registry with KIND, and provide steps to create containers with spring boot

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding new lines and formatting

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating reuse and removing comments

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing reuse

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing line break

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing custom line breaks

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing xml indent to 2 spaces

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/README.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/README.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/README.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/README.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/README.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/consumer-app/src/test/java/io/dapr/springboot/examples/consumer/ConsumerAppTests.java

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update spring-boot-examples/producer-app/src/test/java/io/dapr/springboot/examples/producer/TestSubscriberRestController.java

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* adding license header to missing files

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding automated testing for spring boot example

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding sb examples to the validation pipeline

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating timeouts

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating return codes

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Laurent Broudoux <laurent.broudoux@gmail.com>
Co-authored-by: artur-ciocanu <artur.ciocanu@gmail.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2025-02-28 20:33:40 -08:00
Artur Souza 59abd5dbcc
Does not rely on MAINTAINERS env for merging with auto-merge (#1224)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2025-02-28 16:43:46 -08:00
artur-ciocanu 510679e295
Removing Saga from Dapr Workflows (#1216) 2025-03-01 01:50:14 +02:00
artur-ciocanu bd3a54d6c4
Replacing OkHttpClient with Java 11 HttpClient (#1218)
* Replacing OkHttpClient with Java 11 HttpClient

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjusted the Dapr HTTP tests

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjust tests to use Mockito instead of OkHttp mock interceptor

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Removing OkHTTP from SDK module

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Apparently there is Kotlin deps issue

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add read timeout to HttpClient request

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Use HTTP 1.1

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add file header

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adding back the test related to multiple Monos

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-02-28 13:00:44 -08:00
artur-ciocanu 22d9874ae0
Add app health check support to Dapr Testcontainer (#1213)
* Add app health check support to Dapr Testcontainer

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Some minor cleanup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move waiting to beforeEach, it looks more natural

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-02-09 16:02:43 -08:00
Laurent Broudoux 0cec586d35
feat: Adding basic HTTPEndpoint configuration support in testcontainers module (#1210)
* feat: Adding basic HTTPEndpoint configuration support in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

* feat: #1209 Adding test for HTTPEndpoint in testcontainers module

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>

---------

Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
2025-02-06 11:02:21 -08:00
artur-ciocanu 58d6218861
Register workflows and acitivities using instances along classes (#1201) 2025-02-03 12:22:07 -08:00
salaboy cf7405f976
adding spring boot workflows integration (#1195)
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-02-03 11:28:48 -08:00
artur-ciocanu be5530fdd7
Adding WorkflowTaskOptions and use it instead of TaskOptions (#1200) 2025-01-29 16:22:07 -08:00
TheoneFx be0e56bf50
remove duplicated dependency (#1189)
Signed-off-by: theonefx <chenxilzx1@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2025-01-18 19:04:26 -08:00
salaboy 0fafc97229
removing maven resources plugin dependency from SDK (#1193)
* removing maven resources plugin dependency from SDK

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update pom.xml

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding maven resources plugin as a plugin

Signed-off-by: salaboy <Salaboy@gmail.com>

* Self-validate presence of sdk_version.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2025-01-18 18:15:21 -08:00
Cassie Coyle 9cd6db2f5d
[1.13] up versions to be secure and fix issues due to deprecation (#1187) (#1188) 2025-01-07 17:46:08 -08:00
artur-ciocanu 380cda68f8
Ensure Dapr workflows classes and interfaces have proper packages and visibility (#1176)
* Rename orchestrator and activity wrapper

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move workflow activity to root package

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move workflow context implementation to runtime

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Rename workflow activity context and add an interface

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Convert workflow abstract class to interface

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move saga internals to runtime.saga package

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Tiny typo fix

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adjusting the class names based on feedback

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert accidental JavaDocs commits

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fixing some compilation errors

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2025-01-04 14:39:42 -08:00
salaboy 69f24075f6
Workflows alignment with Spring Boot (Dependency Injection for Workflows and Activities) (#1170)
* evaluating annotations

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding workflows autoconfig

Signed-off-by: salaboy <Salaboy@gmail.com>

* initial @EnableDaprWorkflows implementation

Signed-off-by: salaboy <Salaboy@gmail.com>

* validating managed beans for workflows and activities

Signed-off-by: salaboy <Salaboy@gmail.com>

* [docs] remove 'beta' for Java SDK workflow docs (#1169)

* fix link

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* fix one more link

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* remove beta from Java SDK workflow

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

---------

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Fix create release to run with right JDK (#1171)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Remove test from create release script. (#1172)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Fix typo crashing release script. (#1173)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update master version to 1.14.0-SNAPSHOT (#1174)

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Generate updated javadocs for 1.13.1 (#1179)

Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Co-authored-by: Dapr Bot <daprweb@microsoft.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* upgrading snap

Signed-off-by: salaboy <Salaboy@gmail.com>

* fix checkstyle

Signed-off-by: salaboy <Salaboy@gmail.com>

* Fix conflict and build trigger on right branch for SNAPSHOT. (#1180)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* private internals

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Dapr Bot <daprweb@microsoft.com>
2025-01-02 23:30:42 -08:00
Artur Souza 3a54a5e8c5
up maven plugins and okhttp versions (#1184) (#1185)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2025-01-02 14:19:31 -08:00
salaboy 5413bd0993
fixing all protobuf java to be 3.25.5 (#1182)
Signed-off-by: salaboy <Salaboy@gmail.com>
2024-12-25 18:12:01 -08:00
Artur Souza 6fd5a5a784
Fix conflict and build trigger on right branch for SNAPSHOT. (#1180)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-12-10 08:10:35 -08:00
Artur Souza dec757cba5
Generate updated javadocs for 1.13.1 (#1179)
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
Co-authored-by: Dapr Bot <daprweb@microsoft.com>
2024-12-09 10:53:07 -08:00
Dapr Bot 637927ec18
Update master version to 1.14.0-SNAPSHOT (#1174)
Signed-off-by: Dapr Bot <daprweb@microsoft.com>
2024-12-09 09:40:30 -08:00
Artur Souza 7a07a6e437
Fix typo crashing release script. (#1173)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-12-06 14:02:21 -08:00
Artur Souza 1b37a1c65c
Remove test from create release script. (#1172)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-12-06 13:07:55 -08:00
Artur Souza c21e283ca3
Fix create release to run with right JDK (#1171)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-12-06 06:32:34 -08:00
Hannah Hunter e8a901017f
[docs] remove 'beta' for Java SDK workflow docs (#1169)
* fix link

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* fix one more link

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* remove beta from Java SDK workflow

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

---------

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
2024-12-05 16:19:15 -08:00
salaboy 8b138da07a
replacing subWorkflow to childWorkflow to align with other SDKs (#1168)
Signed-off-by: salaboy <Salaboy@gmail.com>
2024-12-04 11:29:48 -08:00
Artur Souza fcdf3c3188
Implement actor client metadata. (#1165)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-12-03 13:52:14 -08:00
Artur Souza bd1667b043
New overload in invokeBinding + allow null typeref. (#1159)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-12-02 19:28:54 -08:00
salaboy 83e175355e
Fixing vulnerabilities #1162 (#1163) 2024-11-29 13:35:54 -08:00
artur-ciocanu 3dc96d7d73
Simplify OTEL integration to reduce deps (#1160) 2024-11-05 09:49:04 -08:00
artur-ciocanu be05a47fd8
Add Micrometer Observation support to Spring Dapr Messaging (#1150)
* Add Micrometer Observation support to Spring Dapr Messaging

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Remove direct Micrometer deps it is part of Spring Boot

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Remove another explicit dependency

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Hide default observation convention implementation

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix typo in default message builder

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Ensure trace is properly sent using OTEL

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-11-04 18:47:34 -08:00
Artur Souza 0b7a051b79
Fix script tp update release version. (#1153) 2024-10-23 09:59:01 -07:00
Artur Souza b683fcec55
Fix waitForSidecar to respect timeout. (#1146)
* Fix waitForSidecar to respect timeout.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Bring back 500ms interval for retries and log for waitForSidecar

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix flaky test for ConfigurationClientIT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-10-18 07:41:25 -07:00
artur-ciocanu b1196d3777
Adding Dapr configuration support to Testcontainers (#1148)
* Adding Dapr configuration support to Testcontainers

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fixing a small styling issue

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fixing Dapr Testcontainer Component test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix Dapr Testcontainer Subscription test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix Darp Testcontainer Configuration test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix expected YAML structure

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix Configuration test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix Dapr Component test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-10-17 15:37:22 -07:00
salaboy 7dcab0bc68
Adding SpringBoot docs for new integrations (#1123)
* initial docs

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating spring boot integration docs for Java SDK

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update daprdocs/content/en/java-sdk-docs/spring-boot/_index.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update daprdocs/content/en/java-sdk-docs/spring-boot/_index.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update daprdocs/content/en/java-sdk-docs/spring-boot/_index.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update daprdocs/content/en/java-sdk-docs/spring-boot/_index.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-10-16 07:47:47 -07:00
Artur Souza 6a6901d43e
Fix bi-di subscription to support dapr-api-token (#1142)
* Fix bi-di subscription to support dapr-api-token

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove dapr-api-token from actor services

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Handle dapr-api-token for split run tests

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix more tests requiring dapr-api-token

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix IT for HelloWorldClientIT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-10-16 07:20:37 -07:00
Artur Souza 8a0913d4a2
Fix license due to test dependency (#1143) 2024-10-11 20:14:53 -07:00
Artur Souza cb552ba668
Bi-direction subscription (#1124)
* Bi-di subscription.

Add bidi subscription to validate workflow.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Make bi-di subscriber to use Mono

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-10-07 17:00:41 -07:00
Artur Souza 7490434dde
Remove all global state from setProperty (#1138)
* Remove all global state in from setProperty

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* use Map.of

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove dependency that is not needed.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-10-02 15:54:48 -07:00
artur-ciocanu cedaebc157
Ensure we use the same GRPC version everywhere (#1137)
* Ensure we use the same GRPC version everywhere

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Fix actors tests assert

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert Dapr exception asserts

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Increase sleep to allow Spring Context to bootstrap

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert sleep value

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Increase the sleep for messaging test

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Move sleep before each, to ensure Spring context starts

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add more delays to ensure Spring Controller gets the messages

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-09-26 10:41:08 -07:00
Artur Souza 436b7df427
Handle HTTP binding error. (#1024) (#1130)
Update binding http IT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-09-18 11:13:17 -07:00
artur-ciocanu cc537a4c20
Adding Maven Profiles (#1120)
* Adding Maven Profiles

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Simplify profiles setup

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-09-07 03:00:45 -07:00
salaboy 4b83da6327
Adding @ServiceConnection spring boot support with Testcontainers (#1118)
* adding service connection plumbing

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing style

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating sdk-tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprClientAutoConfiguration.java

Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Update dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/PropertiesDaprConnectionDetails.java

Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing details

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding @ServiceConnection to Dapr

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing tests and style

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing test that is not needed anymore

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating starter dependencies

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding juniper testcontainers support

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding new testing module

Signed-off-by: salaboy <Salaboy@gmail.com>

* cleaning sdk-tests deps

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing dead code

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing core that is not needed

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding setters

Signed-off-by: salaboy <Salaboy@gmail.com>

* default constructor

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com>
2024-09-06 10:02:20 -07:00
Yetkin Timocin 9b927c84c2
Fixing typo in invokeBinding functions' definitions (#1116)
Signed-off-by: ytimocin <ytimocin@microsoft.com>
2024-09-04 12:30:38 -07:00
artur-ciocanu 702aa058f7
Add configuration overrides for DaprWorkflowClient and WorkflowRuntimeBuilder (#1113)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-09-04 09:20:44 -07:00
artur-ciocanu 935f3be367
Adding Spring Boot enhancements, Sring Data Repository, Testcontainers (#1089)
* Adding Spring Boot enhancements, Sring Data Repository, Testcontainers

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Try running ITs all at once

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Ensure HTTP and GRPC endpoints are overriden

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-08-29 16:09:48 -07:00
artur-ciocanu a6923ed75c
Adding Dapr Container default wait strategy based on healthz/outbound (#1105)
* Adding Dapr Container default wait strategy based on healthz/outbound

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Ensure Testcontainers Dapr uses the alpha version

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-08-26 08:29:20 -07:00
salaboy b808c92320
Support static Properties overrides on DaprClientBuilder (#1097) 2024-08-23 19:36:01 -07:00
artur-ciocanu 93a7bc5295
Ensure same Spring Boot version is used across different tests (#1109)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-08-22 01:00:47 -07:00
artur-ciocanu 1681816253
Use Eclipse Temurin as OpenJDK distribution (#1107) 2024-08-21 09:58:33 -07:00
artur-ciocanu 43e1c25aab
Fix sdk dependencies (#1103) 2024-08-15 22:54:39 -07:00
Artur Souza 3794cf15d7
Generate updated javadocs for 1.12.0 (#1100)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-08-14 12:32:48 -07:00
Artur Souza 56e5e89fe8
Upgrade the version to 1.13.0-SNAPSHOT (#1099)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-08-13 18:32:40 -07:00
Artur Souza a4958aa474
update dapr runtime + cli to latest rc: 1.14 (#1078) (#1094)
* update dapr runtime + cli to latest rc



* update install url version



* add back v



* trying things for pom.xml



* Fix sdk-autogen proto code gen



* Use 1.14.0-rc.3 CLI for build.yaml



* debug scheduler connection.



* Update CLI to rc6 and runtime to rc4



* Update gRPC and proto dependency in sdk-tests too.



* Update to runtime RC6



* Update error message expectations in 1.15



---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-08-13 17:52:19 -07:00
artur-ciocanu 15bbb39b9e
Drop Java 8 API compatibility, enforce Java 11 API compatibility (#1093)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-08-08 09:32:01 -07:00
salaboy e30dc2df28
Initial Testcontainers integration for Dapr (#1085)
* initial testcontainers pr

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing variable reference

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding equals to spotbug issues

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding http port to run tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating pom

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing style

Signed-off-by: salaboy <Salaboy@gmail.com>

* extracting classes

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing restassured dependency

Signed-off-by: salaboy <Salaboy@gmail.com>

* refactoring IT out to sdk-tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding correct wiremock dep version

Signed-off-by: salaboy <Salaboy@gmail.com>

* missing header

Signed-off-by: salaboy <Salaboy@gmail.com>

* fixing spotbugs issue

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding hashcode too

Signed-off-by: salaboy <Salaboy@gmail.com>

* testing configure method

Signed-off-by: salaboy <Salaboy@gmail.com>

* making inmutable collections and maps

Signed-off-by: salaboy <Salaboy@gmail.com>

* checkstyle

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing space

Signed-off-by: salaboy <Salaboy@gmail.com>

* Refactor tracking of alpha artifact version

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* Use
Usage:  docker compose [OPTIONS] COMMAND

Define and run multi-container applications with Docker

Options:
      --all-resources              Include all resources, even those not used by services
      --ansi string                Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --dry-run                    Execute command in dry run mode
      --env-file stringArray       Specify an alternate environment file
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --progress string            Set type of progress output (auto, tty, plain, quiet) (default "auto")
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first specified, Compose file)
  -p, --project-name string        Project name

Commands:
  attach      Attach local standard input, output, and error streams to a service's running container
  build       Build or rebuild services
  config      Parse, resolve and render compose file in canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service
  down        Stop and remove containers, networks
  events      Receive real time events from containers
  exec        Execute a command in a running container
  images      List images used by the created containers
  kill        Force stop service containers
  logs        View output from containers
  ls          List running compose projects
  pause       Pause services
  port        Print the public port for a port binding
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart service containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service
  scale       Scale services
  start       Start services
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop services
  top         Display the running processes
  unpause     Unpause services
  up          Create and start containers
  version     Show the Docker Compose version information
  wait        Block until the first service container stops
  watch       Watch build context for service and rebuild/refresh containers when files are updated

Run 'docker compose COMMAND --help' for more information on a command. instead of docker-compose

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>

* removing version from docker compose

Signed-off-by: salaboy <Salaboy@gmail.com>

* Update README.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-08-05 00:30:47 -07:00
artur-ciocanu 5618af5ed9
Ensure checkstyle header file is referenced from parent POM (#1087)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-07-24 11:19:31 -07:00
artur-ciocanu a98327e7d9
Ensure checkstyle can be imported into IDE (#1083) 2024-07-19 12:03:03 -07:00
Thomas Vitale 6e0f267b49
Bump supported Spring Boot baseline to version 3.2.x (#1050)
* Drop support for Spring Boot 2.x
* Bump dependencies in sdk-springboot module from Spring Boot 2.x to 3.2.6
* Update examples module to use new Spring Boot support with Java 17 baseline
* Fix wrong sdkman and mavne wrapper setup that failed the local setup
* Update GHA workflow to stop testing for Spring Boot versions < 3.2.x

Fixes gh-1039

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

* Update pom.xml

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-07-16 09:33:53 -07:00
artur-ciocanu 5bf8769585
Add failure messages to GRPC method invoke IT test (#1077) 2024-07-12 10:40:02 -07:00
artur-ciocanu a4ec275353
Adjust latency and jitter for Toxi proxy to stabilize SDK resiliency IT (#1070) 2024-07-09 17:27:12 -07:00
Antonio Maria Sanchez Berrocal 3dadc0be06
Use default state serializer content type if state is not null (#1033)
Signed-off-by: Antonio Sanchez <antonio.maria.sanchez@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-07-03 07:42:38 -07:00
artur-ciocanu a0ee8d1199
Upgrade OTEL to v1.39.0 in integration tests (#1064)
* Upgrading OTEL to 1.39.0

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Revert timeout for GRPC health

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-07-01 13:45:33 -07:00
artur-ciocanu 9afbc3cfc9
Adding path variable names to avoid Spring Boot 3.x issues (#1062) 2024-06-27 15:20:20 -07:00
artur-ciocanu 64f291f3bf
Add missing data to Dapr Metadata and its components (#1059)
* Add missing data to Dapr Metadata and its components

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add metadata field to subscription

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-06-26 11:12:42 -07:00
Artur Souza 363b6f9af8
[cherry-pick] Update Dapr CLI + Add HTTP code to DaprException (#1020)
* Update to 1.13 CLi rc. (#1018)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add support for HTTP status code in exception. (#1019)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-06-25 14:52:47 -07:00
artur-ciocanu 653ba7e707
Expand Dapr metadata API (#1057)
* Expand Dapr metadata API

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Adding extended attributes to Dapr metadata

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

* Add tests for GRPC

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>

---------

Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-06-25 14:03:21 -07:00
Artur Souza d9cfba7e8d
Delete DaprHTTPClient for actors. (#1056)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-06-25 13:22:58 -07:00
artur-ciocanu 48364b1f65
Try to fix one more time after conflicts (#1053)
Signed-off-by: Artur Ciocanu <ciocanu@adobe.com>
Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
2024-06-25 13:22:26 -07:00
salaboy 7e09841b4a
Adding metadata endpoint (#1049)
* adding metadata endpoint

Signed-off-by: salaboy <Salaboy@gmail.com>

* apply formatting

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating formatting

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating formatting

Signed-off-by: salaboy <Salaboy@gmail.com>

* reverting formatting

Signed-off-by: salaboy <Salaboy@gmail.com>

* making domain classes final

Signed-off-by: salaboy <Salaboy@gmail.com>

* making domain model immutable

Signed-off-by: salaboy <Salaboy@gmail.com>

* equals/hashcode

Signed-off-by: salaboy <Salaboy@gmail.com>

* updating tests and clients

Signed-off-by: salaboy <Salaboy@gmail.com>

* rebasing after http client removed

Signed-off-by: salaboy <Salaboy@gmail.com>

* reverting delete

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding space

Signed-off-by: salaboy <Salaboy@gmail.com>

* update copy and spaces

Signed-off-by: salaboy <Salaboy@gmail.com>

* eof line

Signed-off-by: salaboy <Salaboy@gmail.com>

* another new line

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding coverage tests

Signed-off-by: salaboy <Salaboy@gmail.com>

* removing equals and hashcode

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
2024-06-24 22:20:41 -07:00
Artur Souza 502f7c0638
Remove HTTP client and add gRPC interceptor helper. (#1051)
* Remove HTTP client and add gRPC interceptor helper.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* New design for gRPC interceptor and channel proxy.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2024-06-21 06:35:25 -07:00
artur-ciocanu 9048bc1a5e
Increase Kafka container wait time for HTTP bindings examples (#1054) 2024-06-20 10:56:12 -07:00
Laurent Kempé 2a9161077a
Update README.md (#1044)
Standardize README with shield badges

Signed-off-by: Laurent Kempé <laurent.kempe@techheadbrothers.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-06-03 14:53:45 -07:00
Artur Souza faa3af5bbc
Implements full spec of gRPC endpoint. (#1042)
* Implements full spec of gRPC endpoint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix test container dependencies.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add support for /// in gRPC endpoint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update binding example and test to use confluentinc images.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-05-28 14:31:01 -07:00
Eudris Cabrera Rodriguez a074310ec6
updating the holopin.yml to use the sdk badge by default (#1038)
Signed-off-by: Eudris Cabrera <eudris@gmail.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2024-05-09 08:11:22 -07:00
Artur Souza ec29de0479
Dapr docs 1.11.0 (#1026)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-04-26 14:22:03 -07:00
dependabot[bot] 2f5947392a
Bump codecov/codecov-action from 4.0.1 to 4.1.0 (#1023)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.1 to 4.1.0.
- [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/v4.0.1...v4.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 15:55:51 -08:00
Artur Souza aa1fbd53dd
Add workflow_dispatch to Java build workflow. (#1022)
* Add workflow_dispatch to Java build workflow.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix build display name for springboot 3.0

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-02-27 14:40:12 -08:00
Manuel Serra ecc85461ac
fix: use concurrent hashmap (#1017)
Signed-off-by: Manuel Serra <ma.serra@teamsystem.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-02-20 12:11:17 -08:00
Artur Souza 0b5c130293
Automating release (#1016)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-02-20 08:49:12 -08:00
Will 57b86c5d2e
Change "127.0.0.1" to SIDECAR_IP to dynamically account for IPv4 vs. IPv6 environments (#649)
* Generate updated javadocs for 1.3.1 (#643)

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Migrated out of JCenter as a Maven repository manager (#648)

* Upgrade okhttp-mock dependency

Version 1.3.2 was never deployed to Maven Central

* No longer refer to JCenter, as it has been shut down

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* initial commit: modified ./dapr/client/DaprClientHttpTest.java unit test

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* refactored hardcoded 127.0.0.1 localhost IP to use Dapr sidecar IP

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* refactored hardcoded 127.0.0.1 localhost IP to use Dapr sidecar IP

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* cleaned up unused imports

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* fixed tabbing and imports

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* added utils for getting local host and test utils for ipv6 addresses

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Add auto-assign dapr_bot workflow (#654)

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Bump actions/setup-java from 2.3.1 to 2.4.0 (#663)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v2.3.1...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* added HTTP client tests for IPv6 addresses

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* fixed tests by returning SIDECAR_IP to IPv4 address

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* changes to address PMD code validation violations

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* changing back to loopback address for DEFAULT_SIDECAR_IP fallback

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Fix vault example + Upgrade Dapr CLI and runtime. (#666)

* Upgrade Dapr CLI and runtime.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Fix expected vault output.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Update LICENSE to Apache 2.0 (#657)

* Update LICENSE to Apache 2.0

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Update headers to Apache 2.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Bump actions/github-script from 1 to 5 (#655)

Bumps [actions/github-script](https://github.com/actions/github-script) from 1 to 5.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v1...v5)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Add DCO requirements and updated code of conduct (#669)

Issue reference: dapr/docs#2039

Signed-off-by: Will <william.wl.tsai@gmail.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Bump actions/setup-java from 2.4.0 to 2.5.0 (#668)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Config api support (#670)

* inital draft for config api

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Introducing new client for preview apis and code refactoring

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Unit tests and code refactoring

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Adding integration test

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Copyright changes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Review comments fixes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Removed DaprPreviewClientProxy and updated example README

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Adding validate workflow for cofiguration api example

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* fixing example autovalidation and code coverage

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Fixing autovalidation and removing getAllConfiguration

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Fixing review comments

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Add regex header checkstyle.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Fix headers and add javadocs to some.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Update for next release: 1.5.0 snapshot (#672)

* Update CLI and runtime to 1.6.0-rc.x

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Upgrade the version to 1.5.0-SNAPSHOT

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Update proto RC. (#674)

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Java SDK - Documentation for configuration API methods (#676)

* Java SDK - Documentation for configuration API methods

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* review comment fixes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* Generate updated javadocs for 1.4.0 (#677)

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* address package dependency issue on integration test

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* added comment to include spec for ipv6 represention in url

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* corrected comment in NetworkUtils.getHostLoopbackAddress()

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* added comment to include spec for ipv6 represention in url

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* updated dependency scope to test

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>

* fix NetworkUtils.java

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* checkstyle fix in NetworkUtils.java

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* fix imports

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* fix ipv6 formatting issues

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* fix ipv6 formatting issues

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* fix code style nits

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

* refactor formatIpAddress method in actors utls

Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>

---------

Signed-off-by: Will Tsai <william.wl.tsai@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Will <william.wl.tsai@gmail.com>
Signed-off-by: Will <28876888+willtsai@users.noreply.github.com>
Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Maarten Mulders <mthmulders@users.noreply.github.com>
Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: greenie-msft <56556602+greenie-msft@users.noreply.github.com>
Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-02-20 07:55:27 -08:00
Artur Souza 92ccca5185
Improve build name in GH actions to avoid change on patch upgrades. (#1014)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-02-19 11:07:22 -08:00
dependabot[bot] 399e932246
Bump fossas/fossa-action from 1.3.1 to 1.3.3 (#1013)
Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](https://github.com/fossas/fossa-action/compare/v1.3.1...v1.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-02-18 23:25:25 -08:00
dependabot[bot] 578987ea97
Bump com.jayway.jsonpath:json-path from 2.4.0 to 2.9.0 in /sdk-tests (#994)
Bumps [com.jayway.jsonpath:json-path](https://github.com/jayway/JsonPath) from 2.4.0 to 2.9.0.
- [Release notes](https://github.com/jayway/JsonPath/releases)
- [Changelog](https://github.com/json-path/JsonPath/blob/master/changelog.md)
- [Commits](https://github.com/jayway/JsonPath/compare/json-path-2.4.0...json-path-2.9.0)

---
updated-dependencies:
- dependency-name: com.jayway.jsonpath:json-path
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-02-18 23:25:00 -08:00
dependabot[bot] b1a48cd9ba
Bump codecov/codecov-action from 3.1.4 to 4.0.1 (#1001)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 4.0.1.
- [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/v3.1.4...v4.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-18 23:24:41 -08:00
MregXN 14cc3f8549
Add bulk subscriber over gRPC to examples (#871)
* original version of bulk subscriber over gPRC

Signed-off-by: MregXN <mregxn@gmail.com>

* cover validation to grpc subscriber

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README of pubsub example

Signed-off-by: MregXN <mregxn@gmail.com>

* re-trigger validation to pass flaky test

Signed-off-by: MregXN <mregxn@gmail.com>

* Update BulkSubscriberGrpcService.java

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* modify README.md

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-02-16 15:54:57 -08:00
addjuarez 4458f4f20d
Show registered workflows and Activities (#953)
* Show registered workflow

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* Add `NewWorkflowOption` to config version, time, input, etc when start a new workflow (#945)

* add NewWorkflowOption

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* fix style

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add unit test

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add more unit tests for improving coverage

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

---------

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* Update CLI link in example readme's (#951)

* Updated pre-requisite link to Dapr CLI

Signed-off-by: Michaël Hompus <michael@hompus.nl>

* Update JDK list to match all other examples

Signed-off-by: Michaël Hompus <michael@hompus.nl>

---------

Signed-off-by: Michaël Hompus <michael@hompus.nl>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* remove static

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* Add determinstic UUID generation (#947)

* add determinstic UUID generation

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add unit test to improve coverage

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* update grpc version to 1.59.0 to be compatible updated durabletask-java

Signed-off-by: kaibocai <kaibocai@microsoft.com>

---------

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Signed-off-by: kaibocai <kaibocai@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* fix flaky integration test ActorExceptionIT (#954)

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* fix flaky it ActorReminderRecovery (#958)

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* fix flaky integration test MethodInvokeIT (#959)

* fix flaky it MethodInvokeIT

Signed-off-by: MregXN <mregxn@gmail.com>

* add debug print

Signed-off-by: MregXN <mregxn@gmail.com>

* add debug print

Signed-off-by: MregXN <mregxn@gmail.com>

* add more waiting time

Signed-off-by: MregXN <mregxn@gmail.com>

* wait before invoke

Signed-off-by: MregXN <mregxn@gmail.com>

* wait for health before invoke

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* Fix errors

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* make thead safe

* Fix code and test.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>
Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Signed-off-by: Michaël Hompus <michael@hompus.nl>
Signed-off-by: kaibocai <kaibocai@microsoft.com>
Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Co-authored-by: Michaël Hompus <michael@hompus.nl>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-02-16 15:53:33 -08:00
Artur Souza a0ae3c378d
Upgrade springboot to 2.7.18 (#987)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2024-02-15 14:05:11 -08:00
Cassie Coyle a5f0c41fd6
fix the orphaned channel due to the GrpcChannelFacadeTest (#1000)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2024-02-15 14:04:46 -08:00
Cassie Coyle f22d8f8b68
fix the orphaned channel due to the telemetry test (#999)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2024-02-15 14:04:20 -08:00
Cassie Coyle b12c399fdb
Upgrade the version to 1.12.0-SNAPSHOT (#1011)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2024-02-15 14:03:52 -08:00
Cassie Coyle baef245db6
update to latest runtime rc and update protos baseurl (#1010)
* update to latest runtime rc and update protos baseurl

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try fixing protos issue

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2024-02-15 13:19:16 -08:00
Artur Souza 81e6c4d907
Adds error payload to DaprException. (#1009)
* Adds error payload to DaprException.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Keep having http payload in exception message.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix example output.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Lint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix test.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-02-15 10:28:48 -08:00
Cassie Coyle a3cc1384b5
Add the dapr runtime returned error details to the Java DaprException (#998)
* properly add the dapr runtime returned error details to the Java DaprException

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add error handling to sdk docs

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add tests for the dapr exception changes

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try verifyNoMoreInteractions w/ channel

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* verify channel close -> channel close explicitly

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm verifyNoMoreInteractions

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm test to see if that is the orphaned managed channel issue

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* re-add test since that doesnt seem to be the issue

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* channel.close(); -> verify(channel).close();

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Rewrite and redesign of the DaprErrorDetail in DaprException.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update daprdocs too for DaprErrorDetails.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix README.md mm string.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix exception example.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Use runtime 1.13.0-rc.2

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix exception example to match gRPC output.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update error message in IT as per new Dapr runtime version.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Dapr 1.13 is less tolerant of app downtime to keep timers.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-02-13 13:34:50 -08:00
Artur Souza cd81ee8cd4
[Snyk] Fix for 9 vulnerabilities (#1008)
* fix: examples/pom.xml to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6094942
- https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6094943
- https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6097492
- https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6097493
- https://snyk.io/vuln/SNYK-JAVA-COMJAYWAYJSONPATH-6140361
- https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1078499
- https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1298655
- https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-3369748
- https://snyk.io/vuln/SNYK-JAVA-ORGYAML-3152153

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix Examples not to depend on Springboot version for json path.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix new required dependencies.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2024-02-09 10:06:45 -08:00
Cassie Coyle b2968af896
Resolve buildGrpcManagedChannel orphaned channel & ensure connections mocked (#1003)
* okhttpclient is mocked

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* mock workflowRuntime to rm log: 'The sidecar at address localhost:4001 is unavailable. Will continue retrying.'

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix several NetworkUtilsTest orphaned channels

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* reset workflow changes since I still see the log output

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Close daprClient on DaprClientGrpcTelemetryTest

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* try latest runtime rc

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update runtime to 1.12.4

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Mvn test is now verbose, temporatily.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* try fixing RetryPolicyTest

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* comment out RetryPolicyTest

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add RetryPolicyTest back

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* trying to figure out which test func is the issue

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try ubuntu-20.04

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try rm-ing GrpcChannelFacadeTest

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try rm-ing DaprClientHttpTest

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* try t.join just in case

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is this the bad test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* are these other healthcheck tests the problem?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it the ok test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it due to an invoke test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it the config/subscribeConfig tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it noHotMono?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it a publish test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it the other noHotMono tests?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it a state test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it a save state test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it a secret test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it a delete state test?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it the rest -1 and - ending tests?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* no client calls, only end of file remaining

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add teardown - did it work?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* is it just needing daprClientHttpXML to be closed?

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Reuse mock and builder.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Try dedicated executor.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Comment out the remaining tests.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove before and after.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove sdk/src/test/java/io/dapr/client/DaprClientHttpTest.java

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove sdk/src/test/java/io/dapr/client/DaprHttpTest.java.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Delete a batch of tests.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* restore deleted test files

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add back in RetryPolicyTest

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-02-08 14:47:32 -08:00
Artur Souza 22427c9659
Fix unit tests hanging (#1006)
* Fix DaprClientHttpTest and GrpcChannelFacadeTest

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add timeout to build workflow.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Improve RetryPolicyTest.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix dependencies for gRPC mocking.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2024-02-08 13:55:22 -08:00
Elena Kolevska a9a09ba2ac
Adds docs for client initialisation with env variables (#992)
* Adds docs for client init with env variables

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Fix

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Adds DAPR_HTTP_ENDPOINT

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Update daprdocs/content/en/java-sdk-docs/java-client/_index.md

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>

---------

Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
2024-01-24 08:02:36 -08:00
Sky Ao 7eb24ffc69
Add JDK17 and springboot 3.0 support (#975)
* add support for java17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* upgrade spotbugs-maven-plugin version to support jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add clean before install

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add clean in mvn command

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback spotbugs-maven-plugin version to 4.1.4

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add jdk17 in build

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update to support jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove jdk versions earlier than jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove springboot 2.3 and 2.4 because they don't support jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update to jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update maven plugin versions to support jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* temporarily ignoring checking after upgrade to new spotbugs version to support jdk17

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* use the same version of maven-failsafe-plugin

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* hard code maven-failsafe-plugin version to 3.2.2

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* set sourceDirectory of checkstyle plugin to only check the sources directory, not test source and generated source

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* set release to jdk17 in examples subproject

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update to springboot 3.0

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add springboot 3.0.13 in springboot version matrics

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* upgrade to springboot 3.0.13 in sdk-tests

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove Nullable annotation

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* force opentelemetry-sdk-metrics dependencies to be version 0.14.0

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* jakarta.servlet is needed for dapr compatibility for spring boot versions before 3.0

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update code to run with jakarta.servlet and javax.servlet

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update jakarta.annotation to latest version

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add javax.annotation

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* trigger ci

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* revert back to using 3.0 version of the github action

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* revert back to use jdk11 for vallidate

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* jdk17 is required for vallidate

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* trigger ci

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* use jdk17 to validate

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove java8 support

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* use jdk11 to test springboot2.x and jdk17 to test springboot3.0

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback to jdk17 to test for springboot2.x

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rename springboot30 to springboot3

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* skip mvn test in mvn install

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add more exclude for spotbugs

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add more exclude for spotbugs

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* set java source and target to 17 in sdk-tests

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback root pom.xml to remove sdk-tests module

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* exclude logback to avoid conflicts

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* replace ctx.getLogger() with sysout

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update stdout line according to source code

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback validate line, replace ctx.getLogger() with system out in wofklow

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback example code for subworkflow

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* print ctx.getLogger() and instanceId for debug

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback to not exclude logback

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add slf4j as compile dependency and upgrade its version to 2.0.9

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* print the logger implementation class

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove debug code

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

---------

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2024-01-15 08:30:35 -08:00
Sky Ao 4a7b9856ba
Add Saga pattern support in java-sdk (#956)
* first versoin of saga pattern support based on workflow

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add unit test for SagaConfiguration to improve code coverage

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* save draft version before refactory to not hide saga.registerCompensatation

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* remove auto register compensation activity on callActivity()

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* rollback COVEREDRATIO to 80%

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* improve code implementation accordings to proposal

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* use ctx.allOf() to do compensation in parallel

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add code to handle ContinueAsNewInterruption exception for saga compensation

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add saga context for saga related method

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* fix for checkstyle

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

---------

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2024-01-13 12:15:47 -08:00
siebenluke fdb4200a2c
Add additional CloudEvent fields (pubsubname, topic, time, etc) (#866)
* Added additional CloudEvent fields (pubsubname, topic, time, traceid, traceparent, & tracestate)

Added the com.fasterxml.jackson:jackson-datatype-jsr310 dependency to handle serdes of OffsetDateTime for the CloudEvent time field via ObjectMapper settings .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) & .findAndRegisterModules()

Updated com.fasterxml.jackson dependencies to the latest 2.15.1

Added OffsetDateTime as timeValue to test the DefaultObjectSerializer

Added more tests for new & old CloudEvent fields in CloudEventTest & DefaultObjectSerializerTest

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Refactored new field names to be camelCase

Removed the 2 new constructors

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Added @JsonProperty("{lowercasename}")s to properly serdes camelCaseNames as JSON/OBJECT_MAPPER are case-sensitive

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Removed com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency in favor of custom field level serdes for time

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Fixed "Line is longer than 120 characters" build issue by pushing the end of the offending lines to a new line

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Added more CloudEvent test cases to appease Codecov

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Added null binaryData test case for Codecov

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Added cloudEventDifferent test cases for Codecov

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Removed extraneous ;

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

* Added comments for time test cases

Signed-off-by: Luke Sieben <siebenluke@gmail.com>

---------

Signed-off-by: Luke Sieben <siebenluke@gmail.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2024-01-10 17:25:14 -08:00
Sky Ao 3dc2a90711
Fix checkstyle strange behavior (#973)
* set sourceDirectory of checkstyle plugin to only check the sources directory, not test source and generated source

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* hard code upload-artifact version to 3.0.0

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

---------

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-09 13:19:56 -08:00
dependabot[bot] 4ed41ada27
Bump actions/github-script from 6 to 7 (#982)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 12:14:53 -08:00
dependabot[bot] 6fbc5740d9
Bump actions/setup-java from 3 to 4 (#983)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-08 12:14:15 -08:00
dependabot[bot] 91d7e66b5a
Bump actions/setup-go from 4 to 5 (#984)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-08 12:13:47 -08:00
MregXN 02a17de862
fix flaky integration test ActorTimerRecovery (#986)
* fix flaky ActorTimerRecovery IT

Signed-off-by: MregXN <mregxn@gmail.com>

* re-triggered

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-08 12:13:23 -08:00
Cassie Coyle 657fc37a43
add wait for sidecar docs & update java-sdk docs to match .net more w/ client separation (#981)
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-08 12:12:42 -08:00
dependabot[bot] 5c312bd001
Bump actions/checkout from 3 to 4 (#985)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 11:18:13 -08:00
Ryan Lettieri 81a3058223
Improving and Adding Logs for Workflow (#978)
* Initial push for improving/adding logs for workflow

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Cleaning up linter issues

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Altering log level for logging registered activities and workflows

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding in time format to workflow log statements

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing month format for workflow logs

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding in logging test for workflow

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Removing log-level setting from workflow sdk

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Removing time format logging from workflow sdk

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing workflow logging test

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Update WorkflowRuntimeBuilderTest.java

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-01-05 16:21:59 -08:00
MregXN 40617f1c62
wait for actor to be ready (#969)
Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-05 11:48:15 -08:00
dependabot[bot] f65e252d0e
Bump actions/setup-go from 3 to 4 (#841)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2024-01-05 10:52:58 -08:00
addjuarez 8452f8216e
migrate upload-artifact v4 breaking change to fix github workflows (#979)
* set upload-artifact to old version

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

* use distinct artifact names

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>

---------

Signed-off-by: addjuarez <6789375+addjuarez@users.noreply.github.com>
2024-01-05 10:52:03 -08:00
Artur Souza 6759f19f83
Fix doc references to preview for configuration API. (#896)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2023-12-21 22:00:21 -08:00
MregXN 14d836310c
Rewrite gRPC service invocation example (#883)
* original version of service invocation grpc proxying

Signed-off-by: MregXN <mregxn@gmail.com>

* modify formatter and README

Signed-off-by: MregXN <mregxn@gmail.com>

* inject grpc port automatically

Signed-off-by: MregXN <mregxn@gmail.com>

* re-trigger validation

Signed-off-by: MregXN <mregxn@gmail.com>

* use withInterceptors() as MetadataUtils.attachHeaders is deprecated

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie@diagrid.io>
2023-12-21 07:23:19 -08:00
Cassie Coyle 49ccb31dcc
add health check to wait for sidecar and test it (#918)
* add health check to wait for sidecar and test it

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* split long line into 2

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* addRule to failing waitForSidecar test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update the http retry on healthcheck and add to tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add success test since failure scenarios are covered

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update the grpc logic to call the http endpoint

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add endpoint for grpc to be successful

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* up timeout and make return more similar to http

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* up time for test again

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* added comment on getState not being implemented

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add daprhttp to grpc to use and overload constructor

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* shorten time in grpc test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update grpc return to match http check

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* testing if this fixes CI issue on managed channel not closing properly

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* close daprHttp in teardown func

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Fix telemetry test that uses GrpcChannelFacade.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* close daprHttp

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* triggering CI again

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassie Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2023-12-18 20:31:42 -08:00
salaboy 0c7828ee55
Adding dapr api token interceptor for durable task (#963)
* adding dapr api token interceptor for durable task

Signed-off-by: salaboy <Salaboy@gmail.com>

* refactoring interceptor to internal package

Signed-off-by: salaboy <Salaboy@gmail.com>

* refactoring for codestyle

Signed-off-by: salaboy <Salaboy@gmail.com>

* adding file with correct caps

Signed-off-by: salaboy <Salaboy@gmail.com>

* Rename APITokenClientInterceptor.java to ApiTokenClientInterceptor.java

Signed-off-by: salaboy <Salaboy@gmail.com>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
2023-12-12 07:38:35 -08:00
MregXN 4ef96e19f4
fix flaky integration test SdkResiliencytIT (#960)
* fix flaky integration test SdkResiliencytIT

Signed-off-by: MregXN <mregxn@gmail.com>

* Update sdk-tests/src/test/java/io/dapr/it/resiliency/SdkResiliencytIT.java

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

* Update sdk-tests/src/test/java/io/dapr/it/resiliency/SdkResiliencytIT.java

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

* Update sdk-tests/src/test/java/io/dapr/it/resiliency/SdkResiliencytIT.java

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-12-11 10:38:51 +05:30
kaibocai da395f8dac
Improve workflow examples (#949)
* add determinstic UUID generation

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add unit test to improve coverage

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add clearn examples - update grpcversion

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* clean up

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* update readme to using dapr/mechanical-markdown

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* update validate.yml

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* resove readme port issue

Signed-off-by: kaibocai <kaibocai@microsoft.com>

* fix readme.md

Signed-off-by: kaibocai <kaibocai@microsoft.com>

* fix port issue

Signed-off-by: kaibocai <kaibocai@microsoft.com>

* test steps

Signed-off-by: kaibocai <kaibocai@microsoft.com>

* try fix readme validation

Signed-off-by: kaibocai <kaibocai@microsoft.com>

* update readme

Signed-off-by: Kaibo Cai (from Dev Box) <kaibocai@microsoft.com>

* MM readme

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* fix mm error

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add port to readme mm

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add sleep to readme mm

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* update mm for readme

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* fix mm for readme

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* fix readme mm

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* remove mm for continueasnew

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

---------

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Signed-off-by: kaibocai <kaibocai@microsoft.com>
Signed-off-by: Kaibo Cai (from Dev Box) <kaibocai@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-12-04 10:36:16 -08:00
MregXN 3b0747c1fe
wait for actor to be ready (#965)
Signed-off-by: MregXN <mregxn@gmail.com>
2023-11-30 14:28:51 +05:30
MregXN c91c4102d7
fix invoke HEAD method failure (#952)
* fix invoke HEAD method failure

Signed-off-by: MregXN <mregxn@gmail.com>

* add unit test

Signed-off-by: MregXN <mregxn@gmail.com>

* remove unused package

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-11-27 11:14:23 -08:00
MregXN e4cb03f9ec
fix flaky integration test MethodInvokeIT (#959)
* fix flaky it MethodInvokeIT

Signed-off-by: MregXN <mregxn@gmail.com>

* add debug print

Signed-off-by: MregXN <mregxn@gmail.com>

* add debug print

Signed-off-by: MregXN <mregxn@gmail.com>

* add more waiting time

Signed-off-by: MregXN <mregxn@gmail.com>

* wait before invoke

Signed-off-by: MregXN <mregxn@gmail.com>

* wait for health before invoke

Signed-off-by: MregXN <mregxn@gmail.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-11-20 09:27:14 -08:00
MregXN 5c79585e29
fix flaky it ActorReminderRecovery (#958)
Signed-off-by: MregXN <mregxn@gmail.com>
2023-11-20 09:22:36 -08:00
MregXN 3800962cb4
fix flaky integration test ActorExceptionIT (#954)
Signed-off-by: MregXN <mregxn@gmail.com>
2023-11-16 13:31:04 -08:00
kaibocai 4c63abd07d
Add determinstic UUID generation (#947)
* add determinstic UUID generation

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add unit test to improve coverage

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* update grpc version to 1.59.0 to be compatible updated durabletask-java

Signed-off-by: kaibocai <kaibocai@microsoft.com>

---------

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
Signed-off-by: kaibocai <kaibocai@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-11-14 07:59:19 -08:00
Michaël Hompus 1bd2c22b69
Update CLI link in example readme's (#951)
* Updated pre-requisite link to Dapr CLI

Signed-off-by: Michaël Hompus <michael@hompus.nl>

* Update JDK list to match all other examples

Signed-off-by: Michaël Hompus <michael@hompus.nl>

---------

Signed-off-by: Michaël Hompus <michael@hompus.nl>
2023-11-13 10:26:06 -08:00
kaibocai 87a2eb50a5
Add `NewWorkflowOption` to config version, time, input, etc when start a new workflow (#945)
* add NewWorkflowOption

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* fix style

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add unit test

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

* add more unit tests for improving coverage

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>

---------

Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com>
2023-11-06 11:11:22 -08:00
Artur Souza 0d0d59946f
Generate updated javadocs for 1.10.0 (#937)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-10-11 16:55:35 -07:00
Emanuel Alves 5e45aa86b8
Add maven wrapper (#925)
Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-10-08 22:35:19 -07:00
Hannah Hunter cf9ed3f792
[docs] fix another link (#936) 2023-10-06 12:09:39 -07:00
Hannah Hunter 80ed515206
fix link (#935)
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
2023-10-05 16:47:42 -07:00
Artur Souza d192ed8bb6
Next release 1.11.0 snapshot (#934)
* Fix release script to handle workflows sdk.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Upgrade the version to 1.11.0-SNAPSHOT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-10-03 14:12:28 -07:00
Cassie Coyle b6514bb2e4
Updated actor configuration (#914)
* add actor type config

Signed-off-by: MregXN <mregxn@gmail.com>

* add actor reentrancy config

Signed-off-by: MregXN <mregxn@gmail.com>

* add actor type config and object serializer

Signed-off-by: MregXN <mregxn@gmail.com>

* add tests

Signed-off-by: MregXN <mregxn@gmail.com>

* modify tests

Signed-off-by: MregXN <mregxn@gmail.com>

* fix some typos

Signed-off-by: MregXN <mregxn@gmail.com>

* add a test

Signed-off-by: MregXN <mregxn@gmail.com>

* rm actor reentrancy

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm reentrancy from tests

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* fix merge issues due to juint5 refactor being merged and update assertions to conform

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* hopefully fixed merge weirdness

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassie Coyle <cassie@diagrid.io>
Co-authored-by: MregXN <mregxn@gmail.com>
Co-authored-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-10-02 11:04:03 -07:00
Artur Souza 7f76d5b2de
Integration test stabilization + update proto and Dapr runtime to 1.12 RC. (#917)
* Update Dapr runtime to 1.12 RC.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add socket wait for ToxiProxy client.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Changing ambiguity in service Id for TracingIT tests.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* More assertions to SDKResiliencyIT.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add sidecar wait for TracingIT.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Wait for Zipkin endpoint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Tacking flakiness on MethodInvokeIT and TracingIT.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Test again with 1.11.0 CLI.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Start bisect 1.12 regression.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Bisect step for runtime at 34c5102600b5a39704089b72db565ca95943269d

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* bisect step for runtime at ad5618711830510617e1b8fb2d0c6758f14ff6b9

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* bisect step for runtime at 4e5c51be62d8a7319ab25a401681ba82bd3ef7e7

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* git bisect step for runtime at 3143f2fcb679e585d978e9b9d706cce72088fecc

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* git bisect step for runtime at d243d1c6a17b019e0435ebbc10abb00810beb29a

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* git bisect step for runtime at 2ddb99be5ae61abd9f7f3616987fcfda0cedbc6e

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* git bisect step for runtime at 0fdab70eb32a63dd2630c39c4b1bc623212cd099

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* git bisect step for runtime at b42319279f21ee5c63d5cd04bfef6e94897cf34f

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Verify first bad commit at runtime: 0fdab70eb32a63dd2630c39c4b1bc623212cd099

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Trying artursouza/dapr at 37ca4c81041de11677ddea101298ca3c2ad8585d

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add delay of 10s on MethodInvokeService for IT.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Trying dapr at artursouza's fork at 65e117433284388535f5a967456611a72773cf6b

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Change MethodInvokeService to use AppHealthCheck.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Change TracingIT to use AppHealthCheck.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Change to use artursouza's fork at f770694b3fbf7222c162a4ee4e13818a5afc3b01

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove use of artursouza's fork for runtime.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix MethodInvokeIT to actually use AppHealthCheck.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Try fix in runtime: artursouza/dapr at 72b6f7374a670c3054427aa2b01d2374e3bc3329

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Trying runtime as per artursouza at 64d19957059d134378603630165b3e473bdde388

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Increase delay to avoid race condition for app health checks.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Try runtime at artursouza at d2eb15d1707ff8539ff1561a1fd67750d205854b

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update to 1.12.0-rc.5

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2023-10-02 09:15:26 -07:00
Hannah Hunter 96c0418521
add distributed lock example (#930)
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
2023-09-25 10:25:24 -07:00
Emanuel Alves 6c5aa6011a
Update instructions to spin dependent services (#920)
Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-09-22 10:35:14 -07:00
Emanuel Alves 29847ce9a1
Set file encoding property on sdk-tests module (#923)
* Set file encoding on sdk-tests module

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* trigger CI

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

---------

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-09-22 10:34:34 -07:00
Emanuel Alves 56d9270a0a
Migrate to Junit5 (#910)
* Migrating to Junit5

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Fix spotbugs errors

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Fix spotbugs errors

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* remove unreachable code due to expected exception being thrown

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Increase daprRun timeout

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* wait 5 secs before launching toxiproxy

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Rollback spotbugs bump version

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* extract junit-bom version to a property

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Change settings in SdkResiliencyIT to reduce flakiness.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Wait for sidecar in SDKResiliencyIT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2023-09-22 10:25:10 -07:00
huazhongming 86893a0742
Support distributed lock API (#764)
* support distributed lock API

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* add Distributed Lock API Example

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* fix bash

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* fix bash

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* update dapr proto version

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* revert update dapr proto version

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* changed to json serializable

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* fix checkstyle

Signed-off-by: crazyhzm <crazyhzm@gmail.com>

* Fix compilation error due to Mono version change.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: crazyhzm <crazyhzm@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2023-09-21 21:54:59 -07:00
Hannah Hunter b442ba46ad
[docs] Workflow how-to and client example (#890)
* scaffold out docs for java sdk

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* reformat toc

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* pre-test filling in doc

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* update java how to

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* add workflow to client doc

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* small edits

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* tweaks

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* update java sdk how to and client example

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

---------

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
Signed-off-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
2023-09-20 16:16:01 -07:00
Marc Duiker 447ff8676b
Add holopin.yml config (#921)
Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
2023-09-20 13:42:44 -07:00
Artur Souza 3b4d8aeae0
Update Dapr runtime and CLI. (#899)
* Update Dapr runtime and CLI.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update to 1.11.1

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update to 1.11.2

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update to 1.11.3

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2023-09-19 22:00:41 -07:00
Emanuel Alves 0646ac30c8
Exclude 'examples' modules from spotbugs analysis (#906) (#907)
Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
2023-09-19 21:30:07 -07:00
Cassie Coyle 64423bdac6
Docs update examples (#908)
* fixing typos and broken links in examples

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm dup init cmd

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
2023-09-18 23:15:05 -07:00
Sky Ao 4dbcbde14d
Support Dapr API token in workflow client(fix DCO) (#916)
* change to be public to reuse in workflow subproject

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update buildGrpcManagedChannel() method to accept optional parameters for grpc client interceptors

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* support dapr API token while build grpc management channel

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

---------

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
2023-09-17 21:28:03 -07:00
Cassie Coyle 0543011d59
Updated enable dead letter topic (#913)
* feat: Add dead letter topic to a subscription topic.

Signed-off-by: Charlie Mk <carlosrb00@gmail.com>

* feat: Add endpoint examples

Signed-off-by: Charlie Mk <carlosrb00@gmail.com>

* feat: Add dead letter topic example to the docs.

Signed-off-by: Charlie Mk <carlosrb00@gmail.com>

* Create new methods with deadLetterTopic instead of overload existing ones.

Signed-off-by: Charlie Mk <carlosrb00@gmail.com>

* Update _index.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Create overloads for deadlettertopic.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* fix integration tests from names overlapping

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Charlie Mk <carlosrb00@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Co-authored-by: Charlie Mk <carlosrb00@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2023-09-14 17:28:29 -07:00
Mahmut Canga 056aed4d98
Workflow Implementation - Continues... (#880)
* Add ElementType.Type to ActorType (#812)

Signed-off-by: LionTao <taojiachun980831@163.com>

Signed-off-by: LionTao <taojiachun980831@163.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#788)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Update springboot to latest minor.patch version. (#826)

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Use runtime 1.10.0-rc.X and CLI 1.10.0-rc.X (#827)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Upgrade the version to 1.9.0-SNAPSHOT (#829)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Generate updated javadocs for 1.8.0 (#836)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Update Dapr runtime and CLI to 1.10. (#837)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Inject autoconfiguration in the Spring Boot 3 style (#831)

* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91bc1f08ecf2dd3bccf8159fd5d0500e351)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Bump from reactor 2.3.5.RELEASE to 2.7.8 (#830)

* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Test multiple reminder state types + improve timer tests. (#855)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Convert Config API to Stable endpoints. (#846)

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Add PubSub subscriber examples over gPRC (#833)

* add grpc subscriber

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md in examples

Signed-off-by: MregXN <mregxn@gmail.com>

* Modify DaprApplication to support examples where protocol is not specified.

Signed-off-by: MregXN <mregxn@gmail.com>

* modify formatter to pass checkstyle

Signed-off-by: MregXN <mregxn@gmail.com>

* Update springboot to latest minor.patch version. (#826)

Signed-off-by: MregXN <mregxn@gmail.com>

* Use runtime 1.10.0-rc.X and CLI 1.10.0-rc.X (#827)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Upgrade the version to 1.9.0-SNAPSHOT (#829)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Generate updated javadocs for 1.8.0 (#836)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Update Dapr runtime and CLI to 1.10. (#837)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Inject autoconfiguration in the Spring Boot 3 style (#831)

* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91bc1f08ecf2dd3bccf8159fd5d0500e351)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Bump from reactor 2.3.5.RELEASE to 2.7.8 (#830)

* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* rerun checks

Signed-off-by: MregXN <mregxn@gmail.com>

* modify the way of grpc server starts

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README

Signed-off-by: MregXN <mregxn@gmail.com>

* Update pom.xml

Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: champel <champel@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* auto validate actors (#863)

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Bump codecov/codecov-action from 3.1.1 to 3.1.4 (#862)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.4.
- [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/v3.1.1...v3.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Fix 787 (#832)

* prepare before testing

* Update tests

* fix checkstyle

---------

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Upgrade to 1.11 RCs. (#867)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Init for workflows

Signed-off-by: Bill DeRusha <billderusha@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Updating some javadocs and Years.

Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Add missing Header

Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* respond to PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Update workflow example README

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Address PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fixup deprecated pom.xml variable

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Updates based on PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Update pom files per feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* GetInstanceState implementation (#1)

* addiny getInstanceMetadata, waitForInstanceStart and waitForInstanceCompletion implementation
---------

Co-authored-by: aymanmahmoud_microsoft <aymanmahmoud@microsoft.com>
Signed-off-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Management API

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* remove try/catch

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* implementing getIsReplaying() method for Authoring API (#7)

Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>

* Implementing getCurrentInstant() authoring method (#5)

Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>

* Activity Implementation (#3)

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fixing issue with getIsReplaying() call (#8)

Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>

* Generate updated javadocs for 1.9.0 (#878)

* Generate updated javadocs for 1.9.0

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update _index.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Add .sdkmanrc config file and JDK installation instructions (#873)

* Add .sdkmanrc file with installation instructions

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Update README.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Add unit testing example

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* implementing getIsReplaying() method for Authoring API (#7)

Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>

Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fix parent pom

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Send Event Implementation (#10)

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Implementing allOf, anyOf, createTimer methods (#11)

Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>

* Support remote endpoint. (#877)

* Support remote endpoint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Use GRPC_ENDPOINT and HTTP_ENDPOINT in integration tests.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix happy path for waiting for sidecar test.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Add callSubWorkflow Implementation

Co-authored-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>

* rename DemoSubWorkflow

Co-authored-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* continueAsNew Implementation (#13)

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* remove duplicate class

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* add missing mockito test dependency

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* use new workflow client implementation

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* moved implementations to new workflow and context

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* relocate duplicate implemantation

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* remove duplicate test and increase test coverage

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* Implement retry and timeout policy for gRPC client. (#889)

* Implement retry and timeout policy for gRPC client.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix invoke actor after aborted flow.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* renamed getIsReplaying

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* rollback changes on client

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* move workflow runtime state package

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* rename workflow instance state to status

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* remove unnecessary else

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* removed unknown state

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* updated comment

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* updated workflow failure details

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fix style issues

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* rollback merge change

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fixed pom files

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* rollback actors pom changes on autoformat

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fixe actors pom

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fix styling on actors pom

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* fix pom spacing

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* move test to match the package

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* add missing dependencies

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* increased test coverage

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* moved workflow runtime package

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* add exception for missing case

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* add null check for metadata

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* add runtime exception error messages

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* update try catch scope

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* update activity definition to an interface

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* update comments

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* removed redundant method

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

* PR updates

Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>

---------

Signed-off-by: LionTao <taojiachun980831@163.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Bill DeRusha <billderusha@microsoft.com>
Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Signed-off-by: Mahmut Canga <macromania@users.noreply.github.com>
Co-authored-by: LionTao <taojiachun980831@163.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: champel <champel@gmail.com>
Co-authored-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: MatejNedic <matejnedic1@gmail.com>
Co-authored-by: Bill DeRusha <billderusha@microsoft.com>
Co-authored-by: Hannah Kennedy <hakenned@microsoft.com>
Co-authored-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Co-authored-by: Aymalla <Aymalla@outlook.com>
Co-authored-by: aymanmahmoud_microsoft <aymanmahmoud@microsoft.com>
Co-authored-by: swetakumari <swetakumari@microsoft.com>
Co-authored-by: julio <107879411+julioalex-rezende@users.noreply.github.com>
Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Co-authored-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2023-09-12 23:12:38 -07:00
tomsft 85ffe8ed03
small typo fix (#903)
Signed-off-by: tomsft <138026577+tomsft@users.noreply.github.com>
2023-09-11 11:10:16 -07:00
Artur Souza cf8040dd6d
Implement retry and timeout policy for gRPC client. (#889)
* Implement retry and timeout policy for gRPC client.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix invoke actor after aborted flow.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-08-15 22:39:16 -07:00
Bill DeRusha 6d659913b1
Initial Workflow SDK (#857)
* Init for workflows

Signed-off-by: Bill DeRusha <billderusha@microsoft.com>

* Updating some javadocs and Years.

Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>

* Add missing Header

Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>

* respond to PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Update workflow example README

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Address PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* fixup deprecated pom.xml variable

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Updates based on PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Update pom files per feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Add unit testing example

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* update pom

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Fix dependency conflict

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Use Mono and refactor GRPC managed channel builder

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Fix example unit tests

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Implement PR feedback

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* PR Feedback: Revert Mono usage + pom.xml changes

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* pom.xml version fixes

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

* Remove Mono entirely from workflows

Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>

---------

Signed-off-by: Bill DeRusha <billderusha@microsoft.com>
Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Co-authored-by: Hannah Kennedy <hakenned@microsoft.com>
2023-08-10 17:58:09 -07:00
Aaron Crawfis 9dc842faba
Add cascading metadata (#888)
Signed-off-by: Aaron Crawfis <Aaron.Crawfis@microsoft.com>
2023-07-26 10:26:44 -07:00
Artur Souza 76aec01e9a
Fix Java SDK URI parsing. (#882)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-06-22 14:02:43 -07:00
Artur Souza 201dbc5344
Support remote endpoint. (#877)
* Support remote endpoint.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Use GRPC_ENDPOINT and HTTP_ENDPOINT in integration tests.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix happy path for waiting for sidecar test.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-06-18 23:34:09 -07:00
Emanuel Alves d8dbb0e16d
Add .sdkmanrc config file and JDK installation instructions (#873)
* Add .sdkmanrc file with installation instructions

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>

* Update README.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Emanuel Alves <emanuel.j.b.alves@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-06-12 22:43:13 -07:00
Artur Souza 75892fb95f
Generate updated javadocs for 1.9.0 (#878)
* Generate updated javadocs for 1.9.0

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update _index.md

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-06-12 09:57:46 -07:00
Artur Souza d34bcb8c5e
Upgrade the version to 1.10.0-SNAPSHOT (#874)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-06-09 14:35:23 -07:00
Artur Souza d1c61cae40
Upgrade to 1.11 RCs. (#867)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-05-26 05:59:43 +05:30
MatejNedic e03cb1566b
Fix 787 (#832)
* prepare before testing

* Update tests

* fix checkstyle

---------

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-05-25 14:29:19 -07:00
dependabot[bot] e13ad365ff
Bump codecov/codecov-action from 3.1.1 to 3.1.4 (#862)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.4.
- [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/v3.1.1...v3.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 16:26:42 -07:00
Mukundan Sundararajan 787173eff1
auto validate actors (#863)
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-05-24 12:34:24 -07:00
MregXN 375e867ea5
Add PubSub subscriber examples over gPRC (#833)
* add grpc subscriber

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md in examples

Signed-off-by: MregXN <mregxn@gmail.com>

* Modify DaprApplication to support examples where protocol is not specified.

Signed-off-by: MregXN <mregxn@gmail.com>

* modify formatter to pass checkstyle

Signed-off-by: MregXN <mregxn@gmail.com>

* Update springboot to latest minor.patch version. (#826)

Signed-off-by: MregXN <mregxn@gmail.com>

* Use runtime 1.10.0-rc.X and CLI 1.10.0-rc.X (#827)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Upgrade the version to 1.9.0-SNAPSHOT (#829)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Generate updated javadocs for 1.8.0 (#836)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Update Dapr runtime and CLI to 1.10. (#837)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Inject autoconfiguration in the Spring Boot 3 style (#831)

* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91bc1f08ecf2dd3bccf8159fd5d0500e351)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Bump from reactor 2.3.5.RELEASE to 2.7.8 (#830)

* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* rerun checks

Signed-off-by: MregXN <mregxn@gmail.com>

* modify the way of grpc server starts

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README

Signed-off-by: MregXN <mregxn@gmail.com>

* Update pom.xml

Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: champel <champel@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-05-22 07:55:37 -07:00
Mukundan Sundararajan aaa5f7bc76
Convert Config API to Stable endpoints. (#846) 2023-05-09 10:46:54 -07:00
Artur Souza 135b109201
Test multiple reminder state types + improve timer tests. (#855)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-05-05 07:32:16 -07:00
champel 7649ae44b0
Bump from reactor 2.3.5.RELEASE to 2.7.8 (#830)
* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
2023-03-22 09:41:45 -07:00
champel 7d78d1880f
Inject autoconfiguration in the Spring Boot 3 style (#831)
* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91bc1f08ecf2dd3bccf8159fd5d0500e351)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
2023-03-22 09:11:16 -07:00
Artur Souza 806ddc00bd
Update Dapr runtime and CLI to 1.10. (#837)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-02-16 09:53:38 -08:00
Artur Souza 242d93a1ac
Generate updated javadocs for 1.8.0 (#836)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-02-16 09:53:19 -08:00
Artur Souza 10d09619db
Upgrade the version to 1.9.0-SNAPSHOT (#829)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-02-03 09:00:17 -08:00
Artur Souza 339c46e0f1
Use runtime 1.10.0-rc.X and CLI 1.10.0-rc.X (#827)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-02-03 08:36:50 -08:00
Artur Souza 31a47f5521
Update springboot to latest minor.patch version. (#826) 2023-02-02 12:30:22 -08:00
dependabot[bot] a947d5d5b1
Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#788)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-01-25 13:13:00 -08:00
LionTao bd6e91b871
Add ElementType.Type to ActorType (#812)
Signed-off-by: LionTao <taojiachun980831@163.com>

Signed-off-by: LionTao <taojiachun980831@163.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-01-25 13:11:28 -08:00
Artur Souza beafb5a5b3
Deprecate HTTP client with warning. (#824)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2023-01-24 16:50:43 -08:00
Mukundan Sundararajan 81591b9f5b
initial bulk publish impl for java (#789)
* initial bulk publish impl for java

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add UTs and clean up java doc for new interface methods.

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add more interface methods for bulk publish

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* adding examples and ITs for bulk publish

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* addressing review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* use latest ref from dapr branch

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add example validation

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix bindings example validation

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* make changes for latest bulk publish dapr changes

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix examples

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix examples

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix typo

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* test against java 11 only

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* change to latest dapr commit

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* run only pubsub IT, upload failsafe reports as run artifact

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix checkstyle

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix IT report upload condition

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix compile issues

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix spotbugs issue

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* run pubsubIT only

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* change upload artifact name for IT

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix tests

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* introduce sleep

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* test bulk publish with redis

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* change longvalues test to kafka

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* change bulk pub to kafka and revert long values changes

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* remove kafka pubsub from pubsub IT

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* change match order in examples

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* set fail fast as false

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix Internal Invoke exception in ITs

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix IT

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix app scopes in examples

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add content to daprdocs

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix mm.py step comment

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* reset bindings examples readme

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix example, IT and make classes immutable

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2023-01-19 12:57:06 -08:00
Shubham Sharma eb8565cca0
feat(pubsub): add bulk subscribe support (#791) 2023-01-18 17:58:03 -08:00
Artur Souza b83661d109
Update daprd, fix invoke it and improve binding it (#823)
* Use app health check in ITs to minimize flakiness.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Fix DaprRun and update Dapr runtime ref.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Add retry logic to tracing example's validation

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Printing validation steps.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Change retry logic for tracing it

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Updare Dapr ref.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Revert secret.json

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Add gRPC HealthCheck.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Change expectations for invoke tests.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Fix typo causing compilation error.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Update Dapr ref to latest master.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix binding and method invoke ITs.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Add wait time to reduce flakiness of ApiIT.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Re-enable health-check.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove AppHealth as it breaks actor ITs.

Signed-off-by: Artur Souza <artur.barbalho@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Artur Souza <artur.barbalho@outlook.com>
2023-01-16 22:01:00 -08:00
Shubham Sharma 96259e49de
Fix App-IDs across examples and tests (#814)
* Update App IDs across examples and ITs

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Convert string to lower case

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Final

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* re-trigger pipeline

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update tracing IT

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* re-trigger pipeline

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* re-trigger pipeline

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-04 15:56:04 -08:00
dependabot[bot] dcee2f7785
Bump actions/checkout from 2 to 3 (#800)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-12-05 05:05:32 -08:00
Sarthak Sharma 7593b0e078
Update docs for configuration api (#813)
* fix docs for configuration api

Signed-off-by: Sarthak Sharma <sartsharma@microsoft.com>

* Update daprdocs/content/en/java-sdk-docs/_index.md

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Signed-off-by: Sarthak Sharma <sartsharma@microsoft.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-11-25 15:08:28 +05:30
addjuarez bc9de9fa7e
report sdk version in user-agent (#810)
* report sdk version in user-agent

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* make private

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* close input

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* style

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* debug

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* typo

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* use try resource block

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* fix exception

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* newline

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* use defaults

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* Use getSdkVersion()

Signed-off-by: addjuarez <addiajuarez@gmail.com>

Signed-off-by: addjuarez <addiajuarez@gmail.com>
2022-11-20 22:07:02 -08:00
Artur Souza 622844b30a
Generate updated javadocs for 1.7.1 (#809)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-14 21:25:53 -08:00
Artur Souza c0a8c2b1d2
Update to latest Dapr run time and CLI. (#807)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-10 14:06:57 -08:00
John Ewart aeb42d833f
Allow subscription builder to be called with the same route (#805)
If the route being provided for a topic is the same as it was previously,
do not raise an exception.

Fixes parallel test execution without `forkMode=always` (#766)

Signed-off-by: John Ewart <johnewart@microsoft.com>

Signed-off-by: John Ewart <johnewart@microsoft.com>
2022-11-07 11:00:23 -08:00
John Ewart 5dd45adcf2
Update docs regarding changing the protobuf url and skip the cache (#793)
* Update docs regarding changing the protobuf url and skip the cache when downloading protobuf definitions

Signed-off-by: John Ewart <john@johnewart.net>

* Update pom.xml

Changed protobuf base url to point back at commit `683a436ff1367e4ff2d27da2d79069c04ec2c46d`

Signed-off-by: John Ewart <john@johnewart.net>

* Update README.md

Minor change to readme

Signed-off-by: John Ewart <john@johnewart.net>

Signed-off-by: John Ewart <john@johnewart.net>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-06 21:19:21 -08:00
dependabot[bot] 95afd236d8
Bump jackson-databind from 2.12.6.1 to 2.13.4.1 in /sdk (#801)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.12.6.1 to 2.13.4.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-06 21:17:39 -08:00
Artur Souza 186298daf0
Generate updated javadocs for 1.7.0 (#798)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-06 21:17:15 -08:00
Artur Souza a53f02d3d8
Upgrade the version to 1.8.0-SNAPSHOT (#796)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-11-06 21:16:47 -08:00
Artur Souza 5a2833ca63
Update Dapr and CLI to 1.9 RC1 (#795)
* Update Dapr and CLI to 1.9 RC1

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Fix HTTP service invocation without content-type.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Update RCs.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-10-03 11:21:16 -07:00
Pravin Pushkar 04e7298702
Config API : HTTP APIs and Unsubscribe gRPC API changes (#740)
* Config API : Unsubscribe config items changes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Unit and integration tests changes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Addressing review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* GetConfiguration HTTP API impl

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Subscribe and Unsubscribe HTTP changes

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Subscribe config http changes

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Http unsubscribe and unit tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Integration tests for http config apis

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fixing lint

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Chnaging rersponse of HTTP Unsubscribe API

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fix integration test failure

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* refactor IT tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* code clean up

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* setting dapr ref

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Update readme

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Modify Unit tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Remove failing buggy tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix review commnets and integration tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr check

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fix for getAll keys

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fix subscribe All

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Move http subscribe handle to dapr controller

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Simplified examples

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* change dapr ref, and add unit test

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr checks

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr checks

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Use biConsumer to register handlers

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Re use args contructors and re add final modifier

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* put dapr run back

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix nitpick

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Remove the springboot HTTP "convenience".

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-09-29 20:37:46 -07:00
Hannah Hunter 44f80c956d
[Docs] Add input bindings section (#776)
* add input bindings to java doc

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

* add missing code

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
2022-09-14 11:23:53 -07:00
addjuarez bbb6a1d9c0
Removed final from CloudEvent class (#775)
* Remove final from CloudEvent Class

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* Add private field

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* Changing test to not use a complex constructor and double deserialization.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Remove OBJECT_MAPPER.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Signed-off-by: addjuarez <addiajuarez@gmail.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-09-08 17:34:11 -07:00
addjuarez 2cc9e536c8
Update sdk to use configuration dictionaries (#769)
* Update sdk to use configuration maps

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* add ref

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* add ref validate

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* go 1.19

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* fix it test

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* update comments

Signed-off-by: addjuarez <addiajuarez@gmail.com>

* use immutable maps

Signed-off-by: addjuarez <addiajuarez@gmail.com>

Signed-off-by: addjuarez <addiajuarez@gmail.com>
2022-09-05 19:28:34 -07:00
Pravin Pushkar 997c86d526
Added Headers passed through metadata (#770)
* Added Headers passed through metadata

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr check

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
2022-08-30 11:39:28 -07:00
Mr.Black 866b166e11
fix the okhttp3 version bug (#762)
Signed-off-by: RcXu <honeyxhl@163.com>
2022-07-18 03:36:49 -07:00
Artur Souza cff90c0015
Generate updated javadocs for 1.6.0 (#758)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
2022-07-12 09:04:55 -07:00
Mukundan Sundararajan 2c62f5db3e
test with 1.8 rc3 and cli rc1 (#754)
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-06-24 13:54:30 -07:00
Artur Souza 5b2d8f482d
Upgrade the version to 1.7.0-SNAPSHOT (#753)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-06-24 10:13:33 +05:30
Phil Kedy 2235e3d978
Adding pubsub routing support (#631)
* Adding pubsub routing support

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* remove deprecated classes (#704)

* remove deprecated classes

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* remove builder class ref in ITs

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* fix setter in IT

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Address PR comments.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-06-23 11:40:10 -07:00
Artur Souza a9672c4438
Update Dapr runtime to 1.8 RC2. (#752)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-06-23 09:58:52 -07:00
Artur Souza 6ff58e9ee7
Fix integration tests on Windows. (#750)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-06-22 14:18:51 +05:30
Hannah Hunter ea19b26d5d
typo fix (#742)
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
2022-05-26 13:14:26 -07:00
dependabot[bot] b70a9e1057
Bump codecov/codecov-action from 2.1.0 to 3.1.0 (#735)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.1.0...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-05 16:56:10 +05:30
dependabot[bot] 39da710120
Bump fossas/fossa-action from 1.1.0 to 1.3.1 (#737)
Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.1.0 to 1.3.1.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](https://github.com/fossas/fossa-action/compare/v1.1.0...v1.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-05 16:25:57 +05:30
www e2d4d1e1ea
replace vault to local (#719)
* replace vault to local

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* change secret store name style

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* delete vault token file

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* remove vault int validate.yml

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* fix it secret case

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* replace vault to local

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* change secret store name style

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* delete vault token file

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* remove vault int validate.yml

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* fix it secret case

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

* fix it dead loop

Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>

Co-authored-by: zjx244729 <zjx244729@alibaba-inc.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-05-05 13:55:13 +05:30
Shubham Sharma 65936ee963
Pin fossa-action version (#734)
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-04-19 22:51:54 +05:30
dependabot[bot] 81ebd763cd
Bump actions/setup-go from 2 to 3 (#731)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-10 22:00:43 -07:00
Artur Souza 1f2e038439
Generate updated javadocs for 1.5.0 (#730)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-04-08 00:57:41 -07:00
Artur Souza bb6db2ec6b
Upgrade the version to 1.6.0-SNAPSHOT (#727)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-03-31 22:11:32 -07:00
Mukundan Sundararajan 78a7312c75
Test long vals (#717)
* run IT test for long values

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* Fix the class name

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* assert for all messages and fix class name

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* test for Long.MAX_VALUE

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* revert back long number and print

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix the typo

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* update the latest dapr commit in workflow files

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log some more data to debug

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* debug

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* get the value from messages

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix long values assert

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* increasing TTL

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Co-authored-by: tanvigour <tanvi.gour@gmail.com>
Co-authored-by: tanvigour <60332928+tanvigour@users.noreply.github.com>
2022-03-31 21:36:16 -07:00
Artur Souza bfe7f3842a
Update to 1.7.0-rc2 (#720)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-03-30 18:30:00 -07:00
dependabot[bot] 6bdba2244b
Bump jackson-databind from 2.11.3 to 2.12.6.1 in /sdk (#718)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.11.3 to 2.12.6.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-30 16:21:27 -07:00
tanvigour 1ce67387b6
IT test for long values (#713)
* run IT test for long values

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* Fix the class name

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* assert for all messages and fix class name

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* test for Long.MAX_VALUE

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* revert back long number and print

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix the typo

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* update the latest dapr commit in workflow files

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log some more data to debug

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* debug

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* get the value from messages

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* address feedback

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* change the assertion

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* Add hashcode and equals functione and create new obj while adding value to set

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* move iterator

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log value before adding to hashset

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log value before adding to hashset

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log value before adding to hashset

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* change assertion

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* fix equals method

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* adding debugging for expected value

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* adding logs for expected value

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* log value before adding to hashset

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-03-29 15:06:41 -07:00
Mukundan Sundararajan c7cc94d6d9
fix duration parsing (#714) 2022-03-23 22:20:18 -07:00
greenie-msft b0b6c4c7e5
Update tutorial link for observability (#711)
Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>
2022-03-23 21:20:37 +05:30
Mukundan Sundararajan 436586292e
Add IntelliJ IT docs (#705)
* add intellij IT docs

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* use wsl2

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
2022-03-21 20:59:39 -07:00
deepanshuagarwal 593da48bc4
Catering to all possible routes for Post Request (#700)
* Catering to all possible routes for Post Request

Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>

* Correcting checkstyle related violations

Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>

* Refactoring and Adding UTs for post method routes

Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>

* Using resolved topic name

Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>

* Shifting routesPostMethod to reduce its access

Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-03-21 14:27:29 +05:30
Mukundan Sundararajan 06d92dafca
Query State Preview API implementation. (#697)
* Query State Preview API implementation.

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* Use latest dapr ref and fix grpc query state api

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* fix service invocation automatic unesacpe

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* add more unit tests

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* Add query state API docs

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* Fix example to be user friendly

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* Fix example in docs

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* make pagination immutable

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-03-20 21:03:11 -07:00
Sky Ao e3fa24f67b
set maxRequestsPerHost of okhttp to support slow response requests and high TPS (#708)
* set maxRequestsPerHost of okjava to support slow response requests and high TPS

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* fix typo in comments

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update comments

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* update javadoc

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
2022-03-20 21:00:01 -07:00
Pravin Pushkar b7e41a0748
Adding link for MSFT JDK11 in README.md (#707)
Signed-off-by: pravinpushkar <ppushkar@microsoft.com>
2022-03-16 01:00:48 -07:00
Mukundan Sundararajan 0b881d3826
remove deprecated classes (#704)
* remove deprecated classes

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* remove builder class ref in ITs

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

* fix setter in IT

Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
2022-03-15 10:59:12 -07:00
Shubham Sharma 904dbe0b18
Update FOSSA workflow condition to not run on Forks (#706)
* Add workflow and badge

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Encode space in URL

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update FOSSA workflow condition

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-03-15 02:32:46 -07:00
Shubham Sharma eb215fbb3b
Add FOSSA workflow and badge (#703)
* Add workflow and badge

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Encode space in URL

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-03-15 09:51:11 +05:30
dependabot[bot] 36763ea16f
Bump actions/checkout from 2 to 3 (#699)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 08:57:47 +05:30
dependabot[bot] 6bb29072ac
Bump actions/github-script from 5 to 6 (#684)
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-05 22:04:40 +05:30
dependabot[bot] 70d88e71c4
Bump actions/setup-java from 2.5.0 to 3 (#696)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2.5.0 to 3.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v2.5.0...v3)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-03 22:19:40 +05:30
Mukundan Sundararajan 4c077e1de2
fix github action for dapr comment analyzer bot (#680)
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-01-27 11:00:40 -08:00
Pravin Pushkar 9989832b56
Adding javadocs to some Domain classes (#673)
* Adding javadocs to some Domain classes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Fixing code coverage

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* Incorporating review comments

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>
2022-01-27 03:00:49 -08:00
Artur Souza 3e5fe39933
Generate updated javadocs for 1.4.0 (#677) 2022-01-25 09:26:56 -08:00
Pravin Pushkar db33b48fd4
Java SDK - Documentation for configuration API methods (#676)
* Java SDK - Documentation for configuration API methods

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

* review comment fixes

Signed-off-by: pravinpushkar <ppushkar@microsoft.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-01-24 03:30:50 -08:00
Artur Souza 7f87b732c6
Update proto RC. (#674)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-01-20 16:43:52 -08:00
Artur Souza 0c2fcb48a2
Update for next release: 1.5.0 snapshot (#672)
* Update CLI and runtime to 1.6.0-rc.x

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Upgrade the version to 1.5.0-SNAPSHOT

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-01-18 12:28:35 +05:30
1957 changed files with 425329 additions and 216402 deletions

6
.github/holopin.yml vendored Normal file
View File

@ -0,0 +1,6 @@
organization: dapr
defaultSticker: clrqfdv4x24910fl5n4iwu5oa
stickers:
-
id: clrqfdv4x24910fl5n4iwu5oa
alias: sdk-badge

View File

@ -18,14 +18,13 @@ from github import Github
g = Github(os.getenv("GITHUB_TOKEN"))
repo = g.get_repo(os.getenv("GITHUB_REPOSITORY"))
maintainers = [m.strip() for m in os.getenv("MAINTAINERS").split(',')]
def fetch_pulls(mergeable_state):
return [pr for pr in repo.get_pulls(state='open', sort='created') \
if pr.mergeable_state == mergeable_state and 'auto-merge' in [l.name for l in pr.labels]]
def is_approved(pr):
approvers = [r.user.login for r in pr.get_reviews() if r.state == 'APPROVED' and r.user.login in maintainers]
approvers = [r.user.login for r in pr.get_reviews() if r.state == 'APPROVED']
return len([a for a in approvers if repo.get_collaborator_permission(a) in ['admin', 'write']]) > 0
# First, find a PR that can be merged

115
.github/scripts/create-release.sh vendored Executable file
View File

@ -0,0 +1,115 @@
#!/usr/bin/env bash
#
# Copyright 2024 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ue
script_dir=$(readlink -f $(dirname $0))
current_time=$(date +"%Y-%m-%d_%H-%M-%S")
# Thanks to https://ihateregex.io/expr/semver/
SEMVER_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
REL_VERSION=`echo $1 | sed -r 's/^[vV]?([0-9].+)$/\1/'`
if [ `echo $REL_VERSION | pcre2grep "$SEMVER_REGEX"` ]; then
echo "$REL_VERSION is a valid semantic version."
else
echo "$REL_VERSION is not a valid semantic version."
exit 1
fi
MAJOR_MINOR_VERSION=`echo ${REL_VERSION}- | cut -d- -f1 | cut -d. -f1,2`
MAJOR_MINOR_PATCH_VERSION=`echo ${REL_VERSION}- | cut -d- -f1 | cut -d. -f1,2,3`
VARIANT=`echo ${REL_VERSION}- | cut -d- -f2`
if [ "$VARIANT" = "SNAPSHOT" ]; then
echo "SNAPSHOT release detected, updating version in master branch to $REL_VERSION ..."
if [ "$REL_VERSION" != "${MAJOR_MINOR_PATCH_VERSION}-SNAPSHOT" ]; then
echo "Invalid snapshot version: $REL_VERSION"
exit 3
fi
# Change is done directly in the master branch.
${script_dir}/update_sdk_version.sh $REL_VERSION
git commit -s -m "Update master version to ${REL_VERSION}" -a
git clean -f -d
git push origin master
echo "Updated master branch with version ${REL_VERSION}."
exit 0
elif [ "$VARIANT" = "rc" ]; then
echo "Release-candidate version detected: $REL_VERSION"
RC_COUNT=`echo ${REL_VERSION}- | cut -d- -f3`
if ! ((10#${RC_COUNT} >= 0)) 2>/dev/null || [ "$RC_COUNT" == "" ]; then
echo "Invalid release-candidate count: $RC_COUNT"
exit 3
fi
if [ "$REL_VERSION" != "${MAJOR_MINOR_PATCH_VERSION}-rc-${RC_COUNT}" ]; then
echo "Invalid release-candidate version: $REL_VERSION"
exit 3
fi
elif [ "$VARIANT" = "" ]; then
echo "Release version detected: $REL_VERSION"
else
echo "Invalid release variant: $VARIANT"
exit 3
fi
echo "Passed all version format validations."
RELEASE_BRANCH="release-$MAJOR_MINOR_VERSION"
RELEASE_TAG="v$REL_VERSION"
if [ `git rev-parse --verify origin/$RELEASE_BRANCH 2>/dev/null` ]; then
echo "$RELEASE_BRANCH branch already exists, checking it out ..."
git checkout $RELEASE_BRANCH
else
echo "$RELEASE_BRANCH does not exist, creating ..."
git checkout -b $RELEASE_BRANCH
git push origin $RELEASE_BRANCH
fi
echo "$RELEASE_BRANCH branch is ready."
if [ `git rev-parse --verify $RELEASE_TAG 2>/dev/null` ]; then
echo "$RELEASE_TAG tag already exists, checking it out ..."
git checkout $RELEASE_TAG
else
${script_dir}/update_sdk_version.sh $REL_VERSION
git commit -s -m "Release $REL_VERSION" -a
if [ "$VARIANT" = "" ]; then
echo "Generating docs ..."
${script_dir}/update_docs.sh $REL_VERSION
git commit -s -m "Generate updated javadocs for $REL_VERSION" -a
fi
git push origin $RELEASE_BRANCH
echo "Tagging $RELEASE_TAG ..."
git tag $RELEASE_TAG
echo "$RELEASE_TAG is tagged."
echo "Pushing $RELEASE_TAG tag ..."
git push origin $RELEASE_TAG
echo "$RELEASE_TAG tag is pushed."
fi
if [ "$VARIANT" = "" ]; then
git clean -xdf
echo "Updating docs in master branch ..."
git checkout master
git fetch origin
git reset --hard origin/master
git cherry-pick --strategy=recursive -X theirs $RELEASE_TAG
git push origin master
echo "Updated docs in master branch."
fi
echo "Done."

View File

@ -4,19 +4,28 @@ set -uex
DAPR_JAVA_SDK_VERSION=$1
# Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major.
# Replaces the SDK major version to 0 for alpha artifacts.
DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'`
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
rm README.mdbak
else
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
fi
rm -f daprdocs/content/en/java-sdk-docs/_index.mdbak || echo
rm -f daprdocs/content/en/java-sdk-docs/spring-boot/_index.md/_index.mdbak || echo
rm -rf docs
mvn clean install
mvn site-deploy
./mvnw -Dmaven.test.skip=true -Djacoco.skip=true clean install
./mvnw -Dmaven.test.skip=true -Djacoco.skip=true site-deploy

33
.github/scripts/update_sdk_version.sh vendored Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
set -uex
DAPR_JAVA_SDK_VERSION=$1
# Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major.
# Replaces the SDK major version to 0 for alpha artifacts.
DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'`
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-tests/pom.xml
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-tests/pom.xml
###################
# Alpha artifacts #
###################
# sdk-workflows
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-workflows/pom.xml
# testcontainers-dapr
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f testcontainers-dapr/pom.xml
# dapr-spring
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f dapr-spring/pom.xml
# spring-boot-examples
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f spring-boot-examples/pom.xml
git clean -f

View File

@ -22,11 +22,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: pip install PyGithub
- name: Automerge and update
env:
MAINTAINERS: artursouza,mukundansundar
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
run: python ./.github/scripts/automerge.py

View File

@ -1,6 +1,7 @@
name: Build
on:
workflow_dispatch:
push:
branches:
- master
@ -15,44 +16,62 @@ on:
jobs:
build:
name: "Build jdk:${{ matrix.java }} sb:${{ matrix.spring-boot-display-version }} exp:${{ matrix.experimental }}"
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
java: [ 11, 13, 15, 16 ]
java: [ 17 ]
spring-boot-version: [ 3.4.3 ]
spring-boot-display-version: [ 3.4.x ]
experimental: [ false ]
include:
- java: 17
spring-boot-version: 3.3.9
spring-boot-display-version: 3.3.x
experimental: false
env:
GOVER: 1.15.0
GOVER: "1.20"
GOOS: linux
GOARCH: amd64
GOPROXY: https://proxy.golang.org
JDK_VER: ${{ matrix.java }}
DAPR_CLI_VER: 1.5.1
DAPR_RUNTIME_VER: 1.5.1
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.4.0-rc.1/install/install.sh
DAPR_CLI_VER: 1.15.0
DAPR_RUNTIME_VER: 1.15.4
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
DAPR_CLI_REF:
DAPR_REF:
TOXIPROXY_URL: https://github.com/Shopify/toxiproxy/releases/download/v2.5.0/toxiproxy-server-linux-amd64
steps:
- uses: actions/checkout@v2
- name: Install Stable Docker
id: setup_docker
uses: docker/setup-docker-action@v4
- name: Check Docker version
run: docker version
- uses: actions/checkout@v4
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Set up Dapr CLI
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
- name: Set up Go ${{ env.GOVER }}
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
- name: Checkout Dapr CLI repo to override dapr command.
uses: actions/checkout@v2
uses: actions/checkout@v4
if: env.DAPR_CLI_REF != ''
with:
repository: dapr/cli
ref: ${{ env.DAPR_CLI_REF }}
path: cli
- name: Checkout Dapr repo to override daprd.
uses: actions/checkout@v2
uses: actions/checkout@v4
if: env.DAPR_REF != ''
with:
repository: dapr/dapr
@ -83,55 +102,76 @@ jobs:
docker stop dapr_placement
cd dapr
./dist/linux_amd64/release/placement &
- name: Install Local kafka using docker-compose
- name: Spin local environment
run: |
docker-compose -f ./sdk-tests/deploy/local-test-kafka.yml up -d
docker compose -f ./sdk-tests/deploy/local-test.yml up -d mongo kafka
docker ps
- name: Install Local Hashicorp Vault using docker-compose
- name: Install local ToxiProxy to simulate connectivity issues to Dapr sidecar
run: |
docker-compose -f ./sdk-tests/deploy/local-test-vault.yml up -d
docker ps
mkdir -p /home/runner/.local/bin
wget -q ${{ env.TOXIPROXY_URL }} -O /home/runner/.local/bin/toxiproxy-server
chmod +x /home/runner/.local/bin/toxiproxy-server
/home/runner/.local/bin/toxiproxy-server --version
- name: Clean up files
run: mvn clean
run: ./mvnw clean -B
- name: Build sdk
run: mvn compile -q
run: ./mvnw compile -B -q
- name: Unit tests
run: mvn test -q
run: ./mvnw test # making it temporarily verbose.
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v5.4.3
- name: Install jars
run: mvn install -q
- name: Integration tests
run: mvn -f sdk-tests/pom.xml verify -q
run: ./mvnw install -q -B -DskipTests
- name: Integration tests using spring boot version ${{ matrix.spring-boot-version }}
id: integration_tests
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -Pintegration-tests verify
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Upload test report for sdk
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: report-dapr-java-sdk
name: report-dapr-java-sdk-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
path: sdk/target/jacoco-report/
- name: Upload test report for sdk-actors
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: report-dapr-java-sdk-actors
name: report-dapr-java-sdk-actors-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
path: sdk-actors/target/jacoco-report/
- name: Upload failsafe test report for sdk-tests on failure
if: ${{ failure() && steps.integration_tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: failsafe-report-sdk-tests-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
path: sdk-tests/target/failsafe-reports
- name: Upload surefire test report for sdk-tests on failure
if: ${{ failure() && steps.integration_tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: surefire-report-sdk-tests-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
path: sdk-tests/target/surefire-reports
publish:
runs-on: ubuntu-latest
needs: build
timeout-minutes: 30
env:
JDK_VER: 11
JDK_VER: 17
OSSRH_USER_TOKEN: ${{ secrets.OSSRH_USER_TOKEN }}
OSSRH_PWD_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PWD: ${{ secrets.GPG_PWD }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Get pom parent version
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
PARENT_VERSION=$(./mvnw -B -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
echo "PARENT_VERSION=$PARENT_VERSION" >> $GITHUB_ENV
- name: Is SNAPSHOT release ?
if: contains(github.ref, 'master') && contains(env.PARENT_VERSION, '-SNAPSHOT')
@ -143,11 +183,11 @@ jobs:
echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV
- name: Install jars
if: env.DEPLOY_OSSRH == 'true'
run: mvn clean install -q
run: ./mvnw install -DskipTests -B -q
- name: Publish to ossrh
if: env.DEPLOY_OSSRH == 'true'
run: |
echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg
export GPG_TTY=$(tty)
gpg --batch --import private-key.gpg
mvn -V -B -Dgpg.skip=false -s settings.xml deploy -pl \!examples
./mvnw -V -B -Dgpg.skip=false -s settings.xml deploy

56
.github/workflows/create-release.yml vendored Normal file
View File

@ -0,0 +1,56 @@
#
# Copyright 2024 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Create a release
on:
workflow_dispatch:
inputs:
rel_version:
description: 'Release version (examples: 1.9.0-rc-1, 1.9.1, 1.11.0-SNAPSHOT)'
required: true
type: string
jobs:
create-release:
name: Creates release branch and tag
runs-on: ubuntu-latest
env:
JDK_VER: '17'
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.DAPR_BOT_TOKEN }}
persist-credentials: false
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install pcre2-utils
- name: Create release branch and tag
env:
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
run: |
git config user.email "daprweb@microsoft.com"
git config user.name "Dapr Bot"
# Update origin with token
git remote set-url origin https://x-access-token:${{ secrets.DAPR_BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
# Copy first to allow automation to use the latest version and not the release branch's version.
cp -R ./.github/scripts ${RUNNER_TEMP}/
${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }}

View File

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Comment analyzer
uses: actions/github-script@v5
uses: actions/github-script@v7
with:
github-token: ${{secrets.DAPR_BOT_TOKEN}}
script: |
@ -20,7 +20,8 @@ jobs:
if (!isFromPulls && commentBody && commentBody.indexOf("/assign") == 0) {
if (!issue.assignees || issue.assignees.length === 0) {
await github.issues.addAssignees({
// See https://github.com/actions/github-script#breaking-changes-in-v5
await github.rest.issues.addAssignees({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,

46
.github/workflows/fossa.yml vendored Normal file
View File

@ -0,0 +1,46 @@
#
# Copyright 2021 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: fossa
on:
push:
branches:
- master
- release-*
tags:
- v*
pull_request:
branches:
- master
- release-*
workflow_dispatch: {}
jobs:
fossa-scan:
if: github.repository_owner == 'dapr' # FOSSA is not intended to run on forks.
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: b88e1f4287c3108c8751bf106fb46db6 # This is a push-only token that is safe to be exposed.
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Run FOSSA Scan"
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
with:
api-key: ${{ env.FOSSA_API_KEY }}
- name: "Run FOSSA Test"
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
with:
api-key: ${{ env.FOSSA_API_KEY }}
run-tests: true

34
.github/workflows/validate-docs.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Validate Javadocs Generation
on:
workflow_dispatch:
push:
branches:
- master
- release-*
tags:
- v*
pull_request:
branches:
- master
- release-*
jobs:
build:
name: "Validate Javadocs generation"
runs-on: linux-arm64-latest-4-cores
timeout-minutes: 30
env:
JDK_VER: 17
steps:
- uses: actions/checkout@v4
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Install jars
run: ./mvnw install -q -B -DskipTests
- name: Validate Java docs generation
run: ./mvnw site-deploy

View File

@ -28,42 +28,48 @@ jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
java: [ 11, 13, 15, 16 ]
java: [ 17 ]
env:
GOVER: 1.15.0
GOVER: "1.20"
GOOS: linux
GOARCH: amd64
GOPROXY: https://proxy.golang.org
JDK_VER: ${{ matrix.java }}
DAPR_CLI_VER: 1.5.1
DAPR_RUNTIME_VER: 1.5.1
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.4.0-rc.1/install/install.sh
DAPR_CLI_VER: 1.15.0
DAPR_RUNTIME_VER: 1.15.4
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.15.0/install/install.sh
DAPR_CLI_REF:
DAPR_REF:
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Install Stable Docker
id: setup_docker
uses: docker/setup-docker-action@v4
- name: Check Docker version
run: docker version
- name: Set up Dapr CLI
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
- name: Set up Go ${{ env.GOVER }}
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
- name: Checkout Dapr CLI repo to override dapr command.
uses: actions/checkout@v2
uses: actions/checkout@v4
if: env.DAPR_CLI_REF != ''
with:
repository: dapr/cli
ref: ${{ env.DAPR_CLI_REF }}
path: cli
- name: Checkout Dapr repo to override daprd.
uses: actions/checkout@v2
uses: actions/checkout@v4
if: env.DAPR_REF != ''
with:
repository: dapr/dapr
@ -99,58 +105,121 @@ jobs:
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
pip3 install setuptools wheel
pip3 install mechanical-markdown
- name: Install Vault CLI
run: |
# From the installtion page of vault https://learn.hashicorp.com/tutorials/vault/getting-started-install?in=vault/getting-started
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install vault
# Verify vault is installed
vault -h
- name: Verify scheduler is listening on port.
run: sleep 30 && docker logs dapr_scheduler && nc -vz localhost 50006
- name: Clean up files
run: mvn clean
run: ./mvnw clean
- name: Build sdk
run: mvn compile -q
run: ./mvnw compile -q
- name: Install jars
run: mvn install -q
run: ./mvnw install -q
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate Jobs example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/jobs/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate conversation ai example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/conversation/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate invoke http example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/invoke/http/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate invoke grpc example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/invoke/grpc/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate tracing example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/tracing/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate expection handling example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/exception/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate state example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/state/README.md
- name: Validate pubsub HTTP example
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate pubsub example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/pubsub/http/README.md
mm.py ./src/main/java/io/dapr/examples/pubsub/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate bindings HTTP example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/bindings/http/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate secrets example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/secrets/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate unit testing example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/unittesting/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate Configuration API example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/configuration/grpc/README.md
mm.py ./src/main/java/io/dapr/examples/configuration/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate actors example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/actors/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate query state HTTP example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/querystate/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate workflows example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/workflows/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate streaming subscription example
working-directory: ./examples
run: |
mm.py ./src/main/java/io/dapr/examples/pubsub/stream/README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate Spring Boot examples
working-directory: ./spring-boot-examples
run: |
mm.py README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Validate Spring Boot Workflow examples
working-directory: ./spring-boot-examples/workflows
run: |
mm.py README.md
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}

2
.gitignore vendored
View File

@ -1,8 +1,10 @@
# IDE generated files and directories
*.iml
.idea/
.run/
.vs/
.vscode/
.devcontainer/
# Output folders
**/target/

20
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@ -0,0 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

4
.sdkmanrc Normal file
View File

@ -0,0 +1,4 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=17.0.11-tem
maven=3.8.5

View File

@ -12,6 +12,8 @@ This project has adopted the [Contributor Covenant Code of Conduct](https://gith
Contributions come in many forms: submitting issues, writing code, participating in discussions and community calls.
To learn more about becoming a contributor and the different roles within the Dapr community (Contributor, Approver, Maintainer), please refer to our [Community Membership](https://github.com/dapr/community/blob/master/community-membership.md) documentation.
This document provides the guidelines for how to contribute to the Dapr project.
## Issues
@ -49,18 +51,77 @@ Before you file an issue, make sure you've checked the following:
This section describes the guidelines for contributing code / docs to Dapr.
### Things to consider when adding new API to SDK
1. All the new API's go under [dapr-sdk maven package](https://github.com/dapr/java-sdk/tree/master/sdk)
2. Make sure there is an example talking about how to use the API along with a README with mechanical markdown. [Example](https://github.com/dapr/java-sdk/pull/1235/files#diff-69ed756c4c01fd5fa884aac030dccb8f3f4d4fefa0dc330862d55a6f87b34a14)
#### Mechanical Markdown
Mechanical markdown is used to validate example outputs in our CI pipeline. It ensures that the expected output in README files matches the actual output when running the examples. This helps maintain example output, catches any unintended changes in example behavior, and regressions.
To test mechanical markdown locally:
1. Install the package:
```bash
pip3 install mechanical-markdown
```
2. Run the test from the respective examples README directory, for example:
```bash
cd examples
mm.py ./src/main/java/io/dapr/examples/workflows/README.md
```
The test will:
- Parse the STEP markers in the README
- Execute the commands specified in the markers
- Compare the actual output with the expected output
- Report any mismatches
When writing STEP markers:
- Use `output_match_mode: substring` for flexible matching
- Quote strings containing special YAML characters (like `:`, `*`, `'`)
- Set appropriate timeouts for long-running examples
Example STEP marker:
```yaml
<!-- STEP
name: Run example
output_match_mode: substring
expected_stdout_lines:
- "Starting workflow: io.dapr.examples.workflows.compensation.BookTripWorkflow"
...
background: true
timeout_seconds: 60
-->
```
### Pull Requests
All contributions come through pull requests. To submit a proposed change, we recommend following this workflow:
1. Make sure there's an issue (bug or proposal) raised, which sets the expectations for the contribution you are about to make.
1. Fork the relevant repo and create a new branch
1. Create your change
2. Fork the relevant repo and create a new branch
3. Create your change
- Code changes require tests
1. Update relevant documentation for the change
1. Commit and open a PR
1. Wait for the CI process to finish and make sure all checks are green
1. A maintainer of the project will be assigned, and you can expect a review within a few days
4. Update relevant documentation for the change
5. Check the code style
6. Commit and open a PR
7. Wait for the CI process to finish and make sure all checks are green
8. A maintainer of the project will be assigned, and you can expect a review within a few days
9. All the files have the Copyright header.
### Configure the code style with checkstyle
The project contains a checkstyle file (`checkstyle.xml`) that must be used for formatting the code.
* IntelliJ IDEA
You can use [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea).
* VSCode
You can use [Checkstyle for Java](https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle).
* Eclipse
You can use [Eclipse Checkstyle Plugin](https://checkstyle.org/eclipse-cs/#!/)
#### Use work-in-progress PRs for early feedback
@ -120,6 +181,10 @@ A non-exclusive list of code that must be places in `vendor/`:
**Thank You!** - Your contributions to open source, large or small, make projects like this possible. Thank you for taking the time to contribute.
## Github Dapr Bot Commands
Checkout the [daprbot documentation](https://docs.dapr.io/contributing/daprbot/) for Github commands you can run in this repo for common tasks. For example, you can run the `/assign` (as a comment on an issue) to assign the issue to yourself.
## Code of Conduct
This project has adopted the [Contributor Covenant Code of Conduct](https://github.com/dapr/community/blob/master/CODE-OF-CONDUCT.md)

159
README.md
View File

@ -1,10 +1,6 @@
## Dapr SDK for Java
# Dapr SDK for Java
[![Build Status](https://github.com/dapr/java-sdk/workflows/Build/badge.svg?event=push&branch=master)](https://github.com/dapr/java-sdk/actions?workflow=Build)
[![Discord](https://img.shields.io/discord/778680217417809931)](https://discord.com/channels/778680217417809931/778749797242765342)
[![codecov](https://codecov.io/gh/dapr/java-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/dapr/java-sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Maven Central](https://img.shields.io/maven-central/v/io.dapr/dapr-sdk.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.dapr%22%20AND%20a:%22dapr-sdk%22)
[![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)
This is the Dapr SDK for Java, including the following features:
@ -13,15 +9,13 @@ This is the Dapr SDK for Java, including the following features:
* Binding
* State Store
* Actors
* Workflows
### Getting Started
## Getting Started
#### Pre-Requisites
* JDK 11 or above - the published jars are compatible with Java 8:
* [AdoptOpenJDK 11 - LTS](https://adoptopenjdk.net/)
* [Oracle's JDK 15](https://www.oracle.com/java/technologies/javase-jdk15-downloads.html)
* [Oracle's JDK 11 - LTS](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
* [OpenJDK](https://openjdk.java.net/)
### Pre-Requisites
* SDKMAN! installed (recommended):
* [SDKMAN!](https://sdkman.io)
* Java IDE installed:
* [IntelliJ](https://www.jetbrains.com/idea/download/)
* [Eclipse](https://www.eclipse.org/downloads/)
@ -39,8 +33,13 @@ This is the Dapr SDK for Java, including the following features:
* An existing Java Maven or Gradle project. You may also start a new project via one of the options below:
* [New Maven project in IntelliJ](https://www.jetbrains.com/help/idea/maven-support.html#create_new_maven_project)
* [Maven in 5 minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
* [Install toxiproxy-server binary](https://github.com/Shopify/toxiproxy/releases)
#### Importing Dapr's Java SDK
### Install JDK
If using [SDKMAN!](https://sdkman.io), 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:
```xml
<project>
@ -51,19 +50,19 @@ For a Maven project, add the following to your `pom.xml` file:
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
<!-- Dapr's SDK for Actors (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-actors</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
<!-- Dapr's SDK integration with SpringBoot (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-springboot</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
...
</dependencies>
@ -77,15 +76,15 @@ 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.3.1')
compile('io.dapr:dapr-sdk:1.14.1')
// Dapr's SDK for Actors (optional).
compile('io.dapr:dapr-sdk-actors:1.3.1')
compile('io.dapr:dapr-sdk-actors:1.14.1')
// Dapr's SDK integration with SpringBoot (optional).
compile('io.dapr:dapr-sdk-springboot:1.3.1')
compile('io.dapr:dapr-sdk-springboot:1.14.1')
}
```
#### Running the examples
### Running the examples
Clone this repository including the submodules:
```sh
@ -96,28 +95,38 @@ Then head over to build the [Maven](https://maven.apache.org/install.html) (Apac
```sh
# make sure you are in the `java-sdk` directory.
mvn clean install
./mvnw clean install
```
Try the following examples to learn more about Dapr's Java SDK:
* [Invoking a Http service](./examples/src/main/java/io/dapr/examples/invoke/http)
* [Invoking a Grpc service](./examples/src/main/java/io/dapr/examples/invoke/grpc)
* [State management](./examples/src/main/java/io/dapr/examples/state)
* [PubSub with subscriber over Http](./examples/src/main/java/io/dapr/examples/pubsub/http)
* [PubSub with subscriber](./examples/src/main/java/io/dapr/examples/pubsub/)
* [PubSub with streaming subscription](./examples/src/main/java/io/dapr/examples/pubsub/stream/)
* [Binding with input over Http](./examples/src/main/java/io/dapr/examples/bindings/http)
* [Actors](./examples/src/main/java/io/dapr/examples/actors/)
* [Workflows](./examples/src/main/java/io/dapr/examples/workflows/)
* [Secrets management](./examples/src/main/java/io/dapr/examples/secrets)
* [Configuration](./examples/src/main/java/io/dapr/examples/configuration)
* [Distributed tracing with OpenTelemetry SDK](./examples/src/main/java/io/dapr/examples/tracing)
* [Exception handling](./examples/src/main/java/io/dapr/examples/exception)
* [Unit testing](./examples/src/main/java/io/dapr/examples/unittesting)
#### API Documentation
### Running Spring Boot examples
The Spring Boot integration for Dapr use [Testcontainers](https://testcontainers.com) 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](./spring-boot-examples/README.md).
### API Documentation
Please, refer to our [Javadoc](https://dapr.github.io/java-sdk/) website.
#### Reactor API
### Reactor API
The Java SDK for Dapr is built using [Project Reactor](https://projectreactor.io/). It provides an asynchronous API for Java. When consuming a result is consumed synchronously, as in the examples referenced above, the `block()` method is used.
The Java SDK for Dapr is built using [Project Reactor](https://projectreactor.io/). 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](https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html) publisher object. Nothing happens until the application subscribes or blocks on the result:
@ -125,17 +134,17 @@ The code below does not make any API call, it simply returns the [Mono](https://
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:
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:
```java
Mono<Void> result = daprClient.publishEvent("mytopic", "my message");
result.block();
```
#### How to use a custom serializer
### How to use a custom serializer
This SDK provides a basic serialization for request/response objects but also for state objects. Applications should provide their own serialization for production scenarios.
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](https://dapr.github.io/java-sdk/io/dapr/serializer/DaprObjectSerializer.html) interface. See [this class](sdk-actors/src/test/java/io/dapr/actors/runtime/JavaSerializer.java) as example.
1. Implement the [DaprObjectSerializer](https://dapr.github.io/java-sdk/io/dapr/serializer/DaprObjectSerializer.html) interface. See [this class](sdk-actors/src/test/java/io/dapr/actors/runtime/JavaSerializer.java) as an example.
2. Use your serializer class in the following scenarios:
* When building a new instance of [DaprClient](https://dapr.github.io/java-sdk/io/dapr/client/DaprClient.html):
```java
@ -161,13 +170,13 @@ This SDK provides a basic serialization for request/response objects but also fo
```
#### Debug Java application or Dapr's Java SDK
### Debug a Java application or Dapr's Java SDK
**In IntelliJ Community Edition, consider [debugging in IntelliJ](https://docs.dapr.io/developing-applications/ides/intellij/).**
**In IntelliJ Community Edition, consider [debugging in IntelliJ](https://docs.dapr.io/developing-applications/local-development/ides/intellij/).**
**In Visual Studio Code, consider [debugging in Visual Studio Code](https://docs.dapr.io/developing-applications/ides/vscode-debugging/).**
**In Visual Studio Code, consider [debugging in Visual Studio Code](https://docs.dapr.io/developing-applications/local-development/ides/vscode/).**
If you need to debug your Application, run Dapr sidecar separately and then start the application from your IDE (IntelliJ, for example).
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:
```sh
@ -176,33 +185,97 @@ dapr run --app-id testapp --app-port 3000 --dapr-http-port 3500 --dapr-grpc-port
> 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 IDE, make sure the following environment variables are set, so the Java SDK knows how to connect to Dapr's sidecar:
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 (like Eclipse, for example) and debug your Java application, using port `3500` to call Dapr while also listening to port `3000` to expose Dapr's callback endpoint.
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
### Exception handling
Most exceptions thrown from the SDK are instances of `DaprException`. `DaprException` extends from `RuntimeException`, making it compatible with Project Reactor. See [example](./examples/src/main/java/io/dapr/examples/exception) for more details.
Most exceptions thrown from the SDK are instances of `DaprException`. `DaprException` extends from `RuntimeException`, making it compatible with Project Reactor. See the [exception example](./examples/src/main/java/io/dapr/examples/exception) for more details.
### Development
## Development
#### Update proto files
### Update URL to fetch proto files
Change the properties below in [pom.xml](./pom.xml) to point to the desired reference URL in Git. Avoid pointing to `master` branch since it can change over time and create unpredictable behavior in the build.
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.
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.
```xml
<project>
...
<properties>
...
<dapr.proto.url>https://raw.githubusercontent.com/dapr/dapr/v1.0.0/pkg/proto/dapr/dapr.proto</dapr.proto.url>
<dapr.client.proto.url>https://raw.githubusercontent.com/dapr/dapr/v1.0.0/pkg/proto/daprclient/daprclient.proto</dapr.client.proto.url>
<!-- 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
* [Pre-Requisites for the SDK](#pre-requisites)
* Docker installed
* [Docker Compose](https://docs.docker.com/compose/install/)
* [Docker Desktop](https://www.docker.com/products/docker-desktop)
* Bash shell
* In Windows use [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install)
* In Linux and Mac, default shells are enough
#### Code
The code for the tests are present inside the project [sdk-tests](./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), [sdk-springboot](./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.
```bash
docker compose -f ./sdk-tests/deploy/local-test.yml up -d
```
To stop the containers and services, run the following commands.
```bash
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.
```bash
## 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](./examples/src/main/resources/img/intellij-integration-test.png).
> 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.

View File

@ -13,8 +13,8 @@
-->
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
@ -28,262 +28,273 @@
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->
<module name = "Checker">
<property name="charset" value="UTF-8"/>
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="RegexpHeader">
<property name="fileExtensions" value="java"/>
<property name="headerFile" value=".java_header"/>
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
<module name="RegexpHeader">
<property name="fileExtensions" value="java"/>
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="2"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="2"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowedAnnotations" value="Override, Test"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowedAnnotations" value="Override, Test"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
<module name="ImportOrder">
<property name="groups" value="*,javax,java"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="bottom"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
<module name="ImportOrder">
<property name="groups" value="*,javax,java"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="bottom"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="ImportOrder"/>
<property name="message" value="^'java\..*'.*"/>
</module>
<module name="SuppressWarningsHolder"/>
</module>
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="ImportOrder"/>
<property name="message" value="^'java\..*'.*"/>
<module name="SuppressWarningsFilter"/>
<module name="RegexpHeader">
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java,xml"/>
</module>
</module>
<module name="SuppressionSingleFilter">
<property name="checks" value="RegexpHeader"/>
<property name="files" value=".*\.properties$"/>
</module>
<module name="NewlineAtEndOfFile"/>
</module>

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
</parent>
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
<name>dapr-spring-boot-autoconfigure</name>
<description>Dapr Spring Boot Autoconfigure</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-data</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-actors</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-messaging</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-workflows</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-keyvalue</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>testcontainers-dapr</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,43 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
public class ClientPropertiesDaprConnectionDetails implements DaprConnectionDetails {
private final DaprClientProperties daprClientProperties;
public ClientPropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) {
this.daprClientProperties = daprClientProperties;
}
@Override
public String getHttpEndpoint() {
return this.daprClientProperties.getHttpEndpoint();
}
@Override
public String getGrpcEndpoint() {
return this.daprClientProperties.getGrpcEndpoint();
}
@Override
public Integer getHttpPort() {
return this.daprClientProperties.getHttpPort();
}
@Override
public Integer getGrpcPort() {
return this.daprClientProperties.getGrpcPort();
}
}

View File

@ -0,0 +1,151 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
import io.dapr.actors.client.ActorClient;
import io.dapr.actors.runtime.ActorRuntime;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.config.Properties;
import io.dapr.workflows.client.DaprWorkflowClient;
import io.dapr.workflows.runtime.WorkflowRuntimeBuilder;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import java.util.HashMap;
import java.util.Map;
@AutoConfiguration
@ConditionalOnClass(DaprClient.class)
@EnableConfigurationProperties(DaprClientProperties.class)
public class DaprClientAutoConfiguration {
@Bean
@ConditionalOnMissingBean(DaprConnectionDetails.class)
DaprConnectionDetails daprConnectionDetails(DaprClientProperties properties) {
return new ClientPropertiesDaprConnectionDetails(properties);
}
@Bean
@ConditionalOnMissingBean
DaprClientBuilder daprClientBuilder(DaprConnectionDetails daprConnectionDetails) {
DaprClientBuilder builder = createDaprClientBuilder();
String httpEndpoint = daprConnectionDetails.getHttpEndpoint();
if (httpEndpoint != null) {
builder.withPropertyOverride(Properties.HTTP_ENDPOINT, httpEndpoint);
}
String grpcEndpoint = daprConnectionDetails.getGrpcEndpoint();
if (grpcEndpoint != null) {
builder.withPropertyOverride(Properties.GRPC_ENDPOINT, grpcEndpoint);
}
Integer httpPort = daprConnectionDetails.getHttpPort();
if (httpPort != null) {
builder.withPropertyOverride(Properties.HTTP_PORT, String.valueOf(httpPort));
}
Integer grpcPort = daprConnectionDetails.getGrpcPort();
if (grpcPort != null) {
builder.withPropertyOverride(Properties.GRPC_PORT, String.valueOf(grpcPort));
}
return builder;
}
@Bean
@ConditionalOnMissingBean
DaprClient daprClient(DaprClientBuilder daprClientBuilder) {
return daprClientBuilder.build();
}
@Bean
@ConditionalOnMissingBean
DaprWorkflowClient daprWorkflowClient(DaprConnectionDetails daprConnectionDetails) {
Properties properties = createPropertiesFromConnectionDetails(daprConnectionDetails);
return new DaprWorkflowClient(properties);
}
@Bean
@ConditionalOnMissingBean
ActorClient daprActorClient(DaprConnectionDetails daprConnectionDetails) {
Properties properties = createPropertiesFromConnectionDetails(daprConnectionDetails);
return new ActorClient(properties);
}
@Bean
@ConditionalOnMissingBean
ActorRuntime daprActorRuntime(DaprConnectionDetails daprConnectionDetails) {
Properties properties = createPropertiesFromConnectionDetails(daprConnectionDetails);
return ActorRuntime.getInstance(properties);
}
@Bean
@ConditionalOnMissingBean
WorkflowRuntimeBuilder daprWorkflowRuntimeBuilder(DaprConnectionDetails daprConnectionDetails) {
Properties properties = createPropertiesFromConnectionDetails(daprConnectionDetails);
return new WorkflowRuntimeBuilder(properties);
}
/**
* We use this method in tests to override the default DaprClientBuilder.
*/
protected DaprClientBuilder createDaprClientBuilder() {
return new DaprClientBuilder();
}
/**
* Creates a Properties object from the DaprConnectionDetails.
*
* @param daprConnectionDetails the DaprConnectionDetails
* @return the Properties object
*/
protected Properties createPropertiesFromConnectionDetails(DaprConnectionDetails daprConnectionDetails) {
Map<String, String> propertyOverrides = new HashMap<>();
String httpEndpoint = daprConnectionDetails.getHttpEndpoint();
if (httpEndpoint != null) {
propertyOverrides.put(Properties.HTTP_ENDPOINT.getName(), httpEndpoint);
}
Integer httpPort = daprConnectionDetails.getHttpPort();
if (httpPort != null) {
propertyOverrides.put(Properties.HTTP_PORT.getName(), String.valueOf(httpPort));
}
String grpcEndpoint = daprConnectionDetails.getGrpcEndpoint();
if (grpcEndpoint != null) {
propertyOverrides.put(Properties.GRPC_ENDPOINT.getName(), grpcEndpoint);
}
Integer grpcPort = daprConnectionDetails.getGrpcPort();
if (grpcPort != null) {
propertyOverrides.put(Properties.GRPC_PORT.getName(), String.valueOf(grpcPort));
}
return new Properties(propertyOverrides);
}
}

View File

@ -0,0 +1,77 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
import io.dapr.spring.data.DaprKeyValueAdapterResolver;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "dapr.client")
public class DaprClientProperties {
private String httpEndpoint;
private String grpcEndpoint;
private Integer httpPort;
private Integer grpcPort;
/**
* Constructs a {@link DaprClientProperties}.
*/
public DaprClientProperties() {
}
/**
* Constructs a {@link DaprClientProperties}.
* @param httpEndpoint http endpoint to interact with the Dapr Sidecar
* @param grpcEndpoint grpc endpoint to interact with the Dapr Sidecar
* @param httpPort http port to interact with the Dapr Sidecar
* @param grpcPort grpc port to interact with the Dapr Sidecar
*/
public DaprClientProperties(String httpEndpoint, String grpcEndpoint, Integer httpPort, Integer grpcPort) {
this.httpEndpoint = httpEndpoint;
this.grpcEndpoint = grpcEndpoint;
this.httpPort = httpPort;
this.grpcPort = grpcPort;
}
public String getHttpEndpoint() {
return httpEndpoint;
}
public String getGrpcEndpoint() {
return grpcEndpoint;
}
public Integer getHttpPort() {
return httpPort;
}
public Integer getGrpcPort() {
return grpcPort;
}
public void setHttpEndpoint(String httpEndpoint) {
this.httpEndpoint = httpEndpoint;
}
public void setGrpcEndpoint(String grpcEndpoint) {
this.grpcEndpoint = grpcEndpoint;
}
public void setHttpPort(Integer httpPort) {
this.httpPort = httpPort;
}
public void setGrpcPort(Integer grpcPort) {
this.grpcPort = grpcPort;
}
}

View File

@ -0,0 +1,28 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
public interface DaprConnectionDetails extends ConnectionDetails {
String getHttpEndpoint();
String getGrpcEndpoint();
Integer getHttpPort();
Integer getGrpcPort();
}

View File

@ -0,0 +1,44 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.pubsub;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = DaprPubSubProperties.CONFIG_PREFIX)
public class DaprPubSubProperties {
public static final String CONFIG_PREFIX = "dapr.pubsub";
/**
* Name of the PubSub Dapr component.
*/
private String name;
private boolean observationEnabled;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isObservationEnabled() {
return observationEnabled;
}
public void setObservationEnabled(boolean observationEnabled) {
this.observationEnabled = observationEnabled;
}
}

View File

@ -0,0 +1,44 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.statestore;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = DaprStateStoreProperties.CONFIG_PREFIX)
public class DaprStateStoreProperties {
public static final String CONFIG_PREFIX = "dapr.statestore";
/**
* Name of the StateStore Dapr component.
*/
private String name;
private String binding;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBinding() {
return binding;
}
public void setBinding(String binding) {
this.binding = binding;
}
}

View File

@ -0,0 +1 @@
io.dapr.spring.boot.autoconfigure.client.DaprClientAutoConfiguration

View File

@ -0,0 +1,176 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.config.Properties;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Unit tests for {@link DaprClientAutoConfiguration}.
*/
@ExtendWith(MockitoExtension.class)
class DaprClientAutoConfigurationTest {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DaprClientAutoConfiguration.class));
@Mock
private DaprConnectionDetails connectionDetails;
@Mock
private DaprClientBuilder builder;
private DaprClientAutoConfiguration configuration;
@Test
void daprClientBuilder() {
contextRunner.run(context -> assertThat(context).hasSingleBean(DaprClientBuilder.class));
}
@Test
void daprClient() {
contextRunner.run(context -> assertThat(context).hasSingleBean(DaprClient.class));
}
@BeforeEach
void setUp() {
configuration = new TestDaprClientAutoConfiguration(builder);
}
@Test
@DisplayName("Should override HTTP endpoint if it exists")
void shouldOverrideHttpEndpointIfExists() {
String httpEndpoint = "http://localhost:3500";
when(connectionDetails.getHttpEndpoint()).thenReturn(httpEndpoint);
configuration.daprClientBuilder(connectionDetails);
verify(builder).withPropertyOverride(Properties.HTTP_ENDPOINT, httpEndpoint);
}
@Test
@DisplayName("Should override GRPC endpoint if it exists")
void shouldOverrideGrpcEndpointIfExists() {
String grpcEndpoint = "grpc://localhost:5001";
when(connectionDetails.getGrpcEndpoint()).thenReturn(grpcEndpoint);
configuration.daprClientBuilder(connectionDetails);
verify(builder).withPropertyOverride(Properties.GRPC_ENDPOINT, grpcEndpoint);
}
@Test
@DisplayName("Should override HTTP port if it exists")
void shouldOverrideHttpPortIfExists() {
Integer httpPort = 3600;
when(connectionDetails.getHttpPort()).thenReturn(httpPort);
configuration.daprClientBuilder(connectionDetails);
verify(builder).withPropertyOverride(Properties.HTTP_PORT, String.valueOf(httpPort));
}
@Test
@DisplayName("Should override GRPC port if it exists")
void shouldOverrideGrpcPortIfExists() {
Integer grpcPort = 6001;
when(connectionDetails.getGrpcPort()).thenReturn(grpcPort);
configuration.daprClientBuilder(connectionDetails);
verify(builder).withPropertyOverride(Properties.GRPC_PORT, String.valueOf(grpcPort));
}
@Test
@DisplayName("Should override HTTP endpoint in properties if it exists")
void shouldOverrideHttpEndpointInPropertiesIfExists() {
String httpEndpoint = "http://localhost:3500";
when(connectionDetails.getHttpEndpoint()).thenReturn(httpEndpoint);
Properties reuslt = configuration.createPropertiesFromConnectionDetails(connectionDetails);
assertThat(reuslt.getValue(Properties.HTTP_ENDPOINT)).isEqualTo(httpEndpoint);
}
@Test
@DisplayName("Should override GRPC endpoint in properties if it exists")
void shouldOverrideGrpcEndpointPropertiesIfExists() {
String grpcEndpoint = "grpc://localhost:3500";
when(connectionDetails.getGrpcEndpoint()).thenReturn(grpcEndpoint);
Properties result = configuration.createPropertiesFromConnectionDetails(connectionDetails);
assertThat(result.getValue(Properties.GRPC_ENDPOINT)).isEqualTo(grpcEndpoint);
}
@Test
@DisplayName("Should override HTTP port in properties if it exists")
void shouldOverrideHttpPortPropertiesIfExists() {
Integer httpPort = 3600;
when(connectionDetails.getHttpPort()).thenReturn(httpPort);
Properties result = configuration.createPropertiesFromConnectionDetails(connectionDetails);
assertThat(result.getValue(Properties.HTTP_PORT)).isEqualTo(httpPort);
}
@Test
@DisplayName("Should override GRPC port in properties if it exists")
void shouldOverrideGrpcPortPropertiesIfExists() {
Integer grpcPort = 6001;
when(connectionDetails.getGrpcPort()).thenReturn(grpcPort);
Properties result = configuration.createPropertiesFromConnectionDetails(connectionDetails);
assertThat(result.getValue(Properties.GRPC_PORT)).isEqualTo(grpcPort);
}
private static class TestDaprClientAutoConfiguration extends DaprClientAutoConfiguration {
private final DaprClientBuilder daprClientBuilder;
public TestDaprClientAutoConfiguration(DaprClientBuilder daprClientBuilder) {
this.daprClientBuilder = daprClientBuilder;
}
@Override
protected DaprClientBuilder createDaprClientBuilder() {
return daprClientBuilder;
}
}
}

View File

@ -0,0 +1,90 @@
/*
* Copyright 2025 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.client;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
public class DaprClientPropertiesTest {
private final ApplicationContextRunner runner = new ApplicationContextRunner()
.withUserConfiguration(EnableDaprClientProperties.class);
@Test
@DisplayName("Should create DaprClientProperties correctly through constructor")
public void shouldCreateDaprClientPropertiesCorrectly() {
DaprClientProperties properties = new DaprClientProperties(
"http://localhost", "localhost", 3500, 50001
);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
softly.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
softly.assertThat(properties.getHttpPort()).isEqualTo(3500);
softly.assertThat(properties.getGrpcPort()).isEqualTo(50001);
});
}
@Test
@DisplayName("Should create DaprClientProperties correctly through setters")
public void shouldSetDaprClientPropertiesCorrectly() {
DaprClientProperties properties = new DaprClientProperties();
properties.setGrpcEndpoint("localhost");
properties.setGrpcPort(50001);
properties.setHttpEndpoint("http://localhost");
properties.setHttpPort(3500);
SoftAssertions.assertSoftly(softAssertions -> {
softAssertions.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
softAssertions.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
softAssertions.assertThat(properties.getHttpPort()).isEqualTo(3500);
softAssertions.assertThat(properties.getGrpcPort()).isEqualTo(50001);
});
}
@Test
@DisplayName("Should map DaprClient properties correctly")
public void shouldMapDaprClientProperties() {
runner.withSystemProperties(
"dapr.client.http-endpoint=http://localhost",
"dapr.client.http-port=3500",
"dapr.client.grpc-endpoint=localhost",
"dapr.client.grpc-port=50001"
).run(context -> {
DaprClientProperties properties = context.getBean(DaprClientProperties.class);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(properties.getGrpcEndpoint()).isEqualTo("localhost");
softly.assertThat(properties.getHttpEndpoint()).isEqualTo("http://localhost");
softly.assertThat(properties.getHttpPort()).isEqualTo(3500);
softly.assertThat(properties.getGrpcPort()).isEqualTo(50001);
});
});
}
@EnableConfigurationProperties(DaprClientProperties.class)
static class EnableDaprClientProperties {
}
}

View File

@ -0,0 +1,44 @@
package io.dapr.spring.boot.autoconfigure.client;
import io.dapr.spring.boot.autoconfigure.client.workflows.TestActivity;
import io.dapr.spring.boot.autoconfigure.client.workflows.TestWorkflow;
import io.dapr.workflows.client.DaprWorkflowClient;
import io.dapr.workflows.runtime.WorkflowRuntimeBuilder;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@SpringBootTest(classes = {WorkflowTestApplication.class, DaprClientAutoConfiguration.class, TestActivity.class, TestWorkflow.class})
public class DaprWorkflowsRegistrationTests {
@Autowired
private DaprWorkflowClient daprWorkflowClient;
@Autowired
private WorkflowRuntimeBuilder workflowRuntimeBuilder;
@Autowired
private TestActivity testActivity;
@Autowired
private TestWorkflow testWorkflow;
@Test
public void testWorkflowInjection(){
//I cannot test here if the client works, as it needs the runtime
assertNotNull(daprWorkflowClient);
//@TODO: there is no way to assert the runtime and its registered workflows and activities
assertNotNull(workflowRuntimeBuilder);
//Check that both Activities and Workflows are managed beans
assertNotNull(testActivity);
assertNotNull(testWorkflow);
assertNotNull(testActivity.getRestTemplate());
assertNotNull(testWorkflow.getRestTemplate());
}
}

View File

@ -0,0 +1,24 @@
package io.dapr.spring.boot.autoconfigure.client;
import io.dapr.spring.workflows.config.EnableDaprWorkflows;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableDaprWorkflows
public class WorkflowTestApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowTestApplication.class, args);
}
@Configuration
static class Config {
@Bean
RestTemplate restTemplate(){
return new RestTemplate();
}
}
}

View File

@ -0,0 +1,21 @@
package io.dapr.spring.boot.autoconfigure.client.workflows;
import io.dapr.workflows.WorkflowActivity;
import io.dapr.workflows.WorkflowActivityContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestTemplate;
public class TestActivity implements WorkflowActivity {
@Autowired
private RestTemplate restTemplate;
@Override
public Object run(WorkflowActivityContext ctx) {
return "OK";
}
public RestTemplate getRestTemplate() {
return restTemplate;
}
}

View File

@ -0,0 +1,23 @@
package io.dapr.spring.boot.autoconfigure.client.workflows;
import io.dapr.workflows.Workflow;
import io.dapr.workflows.WorkflowStub;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestTemplate;
public class TestWorkflow implements Workflow {
@Autowired
private RestTemplate restTemplate;
@Override
public WorkflowStub create() {
return ctx -> {
ctx.callActivity(TestActivity.class.getName(), null).await();
};
}
public RestTemplate getRestTemplate() {
return restTemplate;
}
}

View File

@ -0,0 +1,60 @@
/*
* Copyright 2025 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.pubsub;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
public class DaprPubSubPropertiesTest {
final ApplicationContextRunner runner = new ApplicationContextRunner()
.withUserConfiguration(EnableDaprPubSubProperties.class);
@Test
@DisplayName("Should configure properties with setters")
void shouldSetProperties() {
DaprPubSubProperties properties = new DaprPubSubProperties();
properties.setName("pubsub");
properties.setObservationEnabled(false);
SoftAssertions.assertSoftly(softAssertions -> {
softAssertions.assertThat(properties.getName()).isEqualTo("pubsub");
softAssertions.assertThat(properties.isObservationEnabled()).isEqualTo(false);
});
}
@Test
@DisplayName("Should map DaprPubSubProperties correctly")
void shouldMapDaprPubSubPropertiesCorrectly() {
runner.withPropertyValues(
"dapr.pubsub.name=pubsub",
"dapr.pubsub.observation-enabled=true"
).run(context -> {
DaprPubSubProperties properties = context.getBean(DaprPubSubProperties.class);
SoftAssertions.assertSoftly(softAssertions -> {
softAssertions.assertThat(properties.getName()).isEqualTo("pubsub");
softAssertions.assertThat(properties.isObservationEnabled()).isEqualTo(true);
});
});
}
@EnableConfigurationProperties(DaprPubSubProperties.class)
static class EnableDaprPubSubProperties {
}
}

View File

@ -0,0 +1,63 @@
/*
* Copyright 2021 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.autoconfigure.statestore;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
public class DaprStateStorePropertiesTest {
final ApplicationContextRunner runner = new ApplicationContextRunner()
.withUserConfiguration(EnableDaprStateStoreProperties.class);
@Test
@DisplayName("Should create DaprStateStoreProperties via constructor")
void shouldSetDaprStateStorePropertiesCorrectly() {
DaprStateStoreProperties properties = new DaprStateStoreProperties();
properties.setBinding("binding");
properties.setName("name");
SoftAssertions.assertSoftly(softAssertions -> {
softAssertions.assertThat(properties.getName()).isEqualTo("name");
softAssertions.assertThat(properties.getBinding()).isEqualTo("binding");
});
}
@Test
@DisplayName("Should map Dapr state store properties correctly")
void shouldMapDaprStateStoreProperties() {
runner.withPropertyValues(
"dapr.statestore.name=name",
"dapr.statestore.binding=binding"
).run(context -> {
DaprStateStoreProperties properties = context.getBean(DaprStateStoreProperties.class);
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(properties.getBinding()).isEqualTo("binding");
softly.assertThat(properties.getName()).isEqualTo("name");
});
});
}
@EnableConfigurationProperties(DaprStateStoreProperties.class)
static class EnableDaprStateStoreProperties {
}
}

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>dapr-spring-boot-starter-test</artifactId>
<name>dapr-spring-boot-starter-test</name>
<description>Dapr Spring Boot Starter Tests (with Testcontainers Support)</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-tests</artifactId>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>testcontainers-dapr</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>dapr-spring-boot-starter</artifactId>
<name>dapr-spring-boot-starter</name>
<description>Dapr Spring Boot Starter</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-springboot</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-data</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-messaging</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-workflows</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
</parent>
<artifactId>dapr-spring-boot-tests</artifactId>
<name>dapr-spring-boot-tests</name>
<description>Dapr Spring Boot Tests</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>testcontainers-dapr</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,58 @@
/*
* Copyright 2021 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.boot.testcontainers.service.connection;
import io.dapr.spring.boot.autoconfigure.client.DaprConnectionDetails;
import io.dapr.testcontainers.DaprContainer;
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
public class DaprContainerConnectionDetailsFactory
extends ContainerConnectionDetailsFactory<DaprContainer, DaprConnectionDetails> {
DaprContainerConnectionDetailsFactory() {
}
protected DaprConnectionDetails getContainerConnectionDetails(ContainerConnectionSource<DaprContainer> source) {
return new DaprContainerConnectionDetails(source);
}
private static final class DaprContainerConnectionDetails
extends ContainerConnectionDetailsFactory.ContainerConnectionDetails<DaprContainer>
implements DaprConnectionDetails {
private DaprContainerConnectionDetails(ContainerConnectionSource<DaprContainer> source) {
super(source);
}
@Override
public String getHttpEndpoint() {
return getContainer().getHttpEndpoint();
}
@Override
public String getGrpcEndpoint() {
return getContainer().getGrpcEndpoint();
}
@Override
public Integer getHttpPort() {
return getContainer().getHttpPort();
}
@Override
public Integer getGrpcPort() {
return getContainer().getGrpcPort();
}
}
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
io.dapr.spring.boot.testcontainers.service.connection.DaprContainerConnectionDetailsFactory

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
</parent>
<artifactId>dapr-spring-data</artifactId>
<name>dapr-spring-data</name>
<description>Dapr Spring Data</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-keyvalue</artifactId>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,147 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import io.dapr.client.DaprClient;
import io.dapr.client.domain.GetStateRequest;
import io.dapr.client.domain.SaveStateRequest;
import io.dapr.client.domain.State;
import io.dapr.utils.TypeRef;
import org.springframework.data.keyvalue.core.KeyValueAdapter;
import org.springframework.data.util.CloseableIterator;
import org.springframework.util.Assert;
import reactor.core.publisher.Mono;
import java.util.Collections;
import java.util.Map;
public abstract class AbstractDaprKeyValueAdapter implements KeyValueAdapter {
private static final Map<String, String> CONTENT_TYPE_META = Map.of(
"contentType", "application/json");
private final DaprClient daprClient;
private final String stateStoreName;
protected AbstractDaprKeyValueAdapter(DaprClient daprClient, String stateStoreName) {
Assert.notNull(daprClient, "DaprClient must not be null");
Assert.hasText(stateStoreName, "State store name must not be empty");
this.daprClient = daprClient;
this.stateStoreName = stateStoreName;
}
@Override
public void destroy() throws Exception {
daprClient.close();
}
@Override
public void clear() {
// Ignore
}
@Override
public Object put(Object id, Object item, String keyspace) {
Assert.notNull(id, "Id must not be null");
Assert.notNull(item, "Item must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
String key = resolveKey(keyspace, id);
State<Object> state = new State<>(key, item, null, CONTENT_TYPE_META, null);
SaveStateRequest request = new SaveStateRequest(stateStoreName).setStates(state);
daprClient.saveBulkState(request).block();
return item;
}
@Override
public boolean contains(Object id, String keyspace) {
return get(id, keyspace) != null;
}
@Override
public Object get(Object id, String keyspace) {
Assert.notNull(id, "Id must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
String key = resolveKey(keyspace, id);
return resolveValue(daprClient.getState(stateStoreName, key, Object.class));
}
@Override
public <T> T get(Object id, String keyspace, Class<T> type) {
Assert.notNull(id, "Id must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
Assert.notNull(type, "Type must not be null");
String key = resolveKey(keyspace, id);
GetStateRequest stateRequest = new GetStateRequest(stateStoreName, key).setMetadata(CONTENT_TYPE_META);
return resolveValue(daprClient.getState(stateRequest, TypeRef.get(type)));
}
@Override
public Object delete(Object id, String keyspace) {
Object result = get(id, keyspace);
if (result == null) {
return null;
}
String key = resolveKey(keyspace, id);
daprClient.deleteState(stateStoreName, key).block();
return result;
}
@Override
public <T> T delete(Object id, String keyspace, Class<T> type) {
T result = get(id, keyspace, type);
if (result == null) {
return null;
}
String key = resolveKey(keyspace, id);
daprClient.deleteState(stateStoreName, key).block();
return result;
}
@Override
public Iterable<?> getAllOf(String keyspace) {
return getAllOf(keyspace, Object.class);
}
@Override
public CloseableIterator<Map.Entry<Object, Object>> entries(String keyspace) {
throw new UnsupportedOperationException("'entries' method is not supported");
}
private String resolveKey(String keyspace, Object id) {
return String.format("%s-%s", keyspace, id);
}
private <T> T resolveValue(Mono<State<T>> state) {
if (state == null) {
return null;
}
return state.blockOptional().map(State::getValue).orElse(null);
}
}

View File

@ -0,0 +1,97 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.client.domain.ComponentMetadata;
import io.dapr.client.domain.DaprMetadata;
import org.springframework.data.keyvalue.core.KeyValueAdapter;
import java.util.List;
import java.util.Set;
public class DaprKeyValueAdapterResolver implements KeyValueAdapterResolver {
private static final Set<String> MYSQL_MARKERS = Set.of("state.mysql-v1", "bindings.mysql-v1");
private static final Set<String> POSTGRESQL_MARKERS = Set.of("state.postgresql-v1", "bindings.postgresql-v1");
private final DaprClient daprClient;
private final ObjectMapper mapper;
private final String stateStoreName;
private final String bindingName;
/**
* Constructs a {@link DaprKeyValueAdapterResolver}.
*
* @param daprClient The Dapr client.
* @param mapper The object mapper.
* @param stateStoreName The state store name.
* @param bindingName The binding name.
*/
public DaprKeyValueAdapterResolver(DaprClient daprClient, ObjectMapper mapper, String stateStoreName,
String bindingName) {
this.daprClient = daprClient;
this.mapper = mapper;
this.stateStoreName = stateStoreName;
this.bindingName = bindingName;
}
@Override
public KeyValueAdapter resolve() {
DaprMetadata metadata = daprClient.getMetadata().block();
if (metadata == null) {
throw new IllegalStateException("No Dapr metadata found");
}
List<ComponentMetadata> components = metadata.getComponents();
if (components == null || components.isEmpty()) {
throw new IllegalStateException("No components found in Dapr metadata");
}
if (shouldUseMySQL(components, stateStoreName, bindingName)) {
return new MySQLDaprKeyValueAdapter(daprClient, mapper, stateStoreName, bindingName);
}
if (shouldUsePostgreSQL(components, stateStoreName, bindingName)) {
return new PostgreSQLDaprKeyValueAdapter(daprClient, mapper, stateStoreName, bindingName);
}
throw new IllegalStateException("Could find any adapter matching the given state store and binding");
}
@SuppressWarnings("AbbreviationAsWordInName")
private boolean shouldUseMySQL(List<ComponentMetadata> components, String stateStoreName, String bindingName) {
boolean stateStoreMatched = components.stream().anyMatch(x -> matchBy(stateStoreName, MYSQL_MARKERS, x));
boolean bindingMatched = components.stream().anyMatch(x -> matchBy(bindingName, MYSQL_MARKERS, x));
return stateStoreMatched && bindingMatched;
}
@SuppressWarnings("AbbreviationAsWordInName")
private boolean shouldUsePostgreSQL(List<ComponentMetadata> components, String stateStoreName, String bindingName) {
boolean stateStoreMatched = components.stream().anyMatch(x -> matchBy(stateStoreName, POSTGRESQL_MARKERS, x));
boolean bindingMatched = components.stream().anyMatch(x -> matchBy(bindingName, POSTGRESQL_MARKERS, x));
return stateStoreMatched && bindingMatched;
}
private boolean matchBy(String name, Set<String> markers, ComponentMetadata componentMetadata) {
return componentMetadata.getName().equals(name) && markers.contains(getTypeAndVersion(componentMetadata));
}
private String getTypeAndVersion(ComponentMetadata component) {
return component.getType() + "-" + component.getVersion();
}
}

View File

@ -0,0 +1,402 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.dao.support.PersistenceExceptionTranslator;
import org.springframework.data.domain.Sort;
import org.springframework.data.keyvalue.core.IdentifierGenerator;
import org.springframework.data.keyvalue.core.KeyValueAdapter;
import org.springframework.data.keyvalue.core.KeyValueCallback;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.core.KeyValuePersistenceExceptionTranslator;
import org.springframework.data.keyvalue.core.event.KeyValueEvent;
import org.springframework.data.keyvalue.core.mapping.KeyValuePersistentEntity;
import org.springframework.data.keyvalue.core.mapping.KeyValuePersistentProperty;
import org.springframework.data.keyvalue.core.mapping.context.KeyValueMappingContext;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
public class DaprKeyValueTemplate implements KeyValueOperations, ApplicationEventPublisherAware {
private static final PersistenceExceptionTranslator DEFAULT_PERSISTENCE_EXCEPTION_TRANSLATOR =
new KeyValuePersistenceExceptionTranslator();
private final KeyValueAdapter adapter;
private final MappingContext<? extends KeyValuePersistentEntity<?, ?>, ? extends KeyValuePersistentProperty<?>>
mappingContext;
private final IdentifierGenerator identifierGenerator;
private PersistenceExceptionTranslator exceptionTranslator = DEFAULT_PERSISTENCE_EXCEPTION_TRANSLATOR;
private @Nullable ApplicationEventPublisher eventPublisher;
private boolean publishEvents = false;
private @SuppressWarnings("rawtypes") Set<Class<? extends KeyValueEvent>> eventTypesToPublish = Collections
.emptySet();
/**
* Create new {@link DaprKeyValueTemplate} using the given {@link KeyValueAdapterResolver} with a default
* {@link KeyValueMappingContext}.
*
* @param resolver must not be {@literal null}.
*/
public DaprKeyValueTemplate(KeyValueAdapterResolver resolver) {
this(resolver, new KeyValueMappingContext<>());
}
/**
* Create new {@link DaprKeyValueTemplate} using the given {@link KeyValueAdapterResolver} and {@link MappingContext}.
*
* @param resolver must not be {@literal null}.
* @param mappingContext must not be {@literal null}.
*/
@SuppressWarnings("LineLength")
public DaprKeyValueTemplate(KeyValueAdapterResolver resolver,
MappingContext<? extends KeyValuePersistentEntity<?, ?>, ? extends KeyValuePersistentProperty<?>> mappingContext) {
this(resolver, mappingContext, DefaultIdentifierGenerator.INSTANCE);
}
/**
* Create new {@link DaprKeyValueTemplate} using the given {@link KeyValueAdapterResolver} and {@link MappingContext}.
*
* @param resolver must not be {@literal null}.
* @param mappingContext must not be {@literal null}.
* @param identifierGenerator must not be {@literal null}.
*/
@SuppressWarnings("LineLength")
public DaprKeyValueTemplate(KeyValueAdapterResolver resolver,
MappingContext<? extends KeyValuePersistentEntity<?, ?>, ? extends KeyValuePersistentProperty<?>> mappingContext,
IdentifierGenerator identifierGenerator) {
Assert.notNull(resolver, "Resolver must not be null");
Assert.notNull(mappingContext, "MappingContext must not be null");
Assert.notNull(identifierGenerator, "IdentifierGenerator must not be null");
this.adapter = resolver.resolve();
this.mappingContext = mappingContext;
this.identifierGenerator = identifierGenerator;
}
private static boolean typeCheck(Class<?> requiredType, @Nullable Object candidate) {
return candidate == null || ClassUtils.isAssignable(requiredType, candidate.getClass());
}
public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator) {
Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null");
this.exceptionTranslator = exceptionTranslator;
}
/**
* Set the {@link ApplicationEventPublisher} to be used to publish {@link KeyValueEvent}s.
*
* @param eventTypesToPublish must not be {@literal null}.
*/
@SuppressWarnings("rawtypes")
public void setEventTypesToPublish(Set<Class<? extends KeyValueEvent>> eventTypesToPublish) {
if (CollectionUtils.isEmpty(eventTypesToPublish)) {
this.publishEvents = false;
} else {
this.publishEvents = true;
this.eventTypesToPublish = Collections.unmodifiableSet(eventTypesToPublish);
}
}
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.eventPublisher = applicationEventPublisher;
}
@Override
public <T> T insert(T objectToInsert) {
KeyValuePersistentEntity<?, ?> entity = getKeyValuePersistentEntity(objectToInsert);
GeneratingIdAccessor generatingIdAccessor = new GeneratingIdAccessor(
entity.getPropertyAccessor(objectToInsert),
entity.getIdProperty(),
identifierGenerator
);
Object id = generatingIdAccessor.getOrGenerateIdentifier();
return insert(id, objectToInsert);
}
@Override
public <T> T insert(Object id, T objectToInsert) {
Assert.notNull(id, "Id for object to be inserted must not be null");
Assert.notNull(objectToInsert, "Object to be inserted must not be null");
String keyspace = resolveKeySpace(objectToInsert.getClass());
potentiallyPublishEvent(KeyValueEvent.beforeInsert(id, keyspace, objectToInsert.getClass(), objectToInsert));
execute((KeyValueCallback<Void>) adapter -> {
if (adapter.contains(id, keyspace)) {
throw new DuplicateKeyException(
String.format("Cannot insert existing object with id %s; Please use update", id));
}
adapter.put(id, objectToInsert, keyspace);
return null;
});
potentiallyPublishEvent(KeyValueEvent.afterInsert(id, keyspace, objectToInsert.getClass(), objectToInsert));
return objectToInsert;
}
@Override
public <T> T update(T objectToUpdate) {
KeyValuePersistentEntity<?, ?> entity = getKeyValuePersistentEntity(objectToUpdate);
if (!entity.hasIdProperty()) {
throw new InvalidDataAccessApiUsageException(
String.format("Cannot determine id for type %s", ClassUtils.getUserClass(objectToUpdate)));
}
return update(entity.getIdentifierAccessor(objectToUpdate).getRequiredIdentifier(), objectToUpdate);
}
@Override
public <T> T update(Object id, T objectToUpdate) {
Assert.notNull(id, "Id for object to be inserted must not be null");
Assert.notNull(objectToUpdate, "Object to be updated must not be null");
String keyspace = resolveKeySpace(objectToUpdate.getClass());
potentiallyPublishEvent(KeyValueEvent.beforeUpdate(id, keyspace, objectToUpdate.getClass(), objectToUpdate));
Object existing = execute(adapter -> adapter.put(id, objectToUpdate, keyspace));
potentiallyPublishEvent(
KeyValueEvent.afterUpdate(id, keyspace, objectToUpdate.getClass(), objectToUpdate, existing));
return objectToUpdate;
}
@Override
public <T> Optional<T> findById(Object id, Class<T> type) {
Assert.notNull(id, "Id for object to be found must not be null");
Assert.notNull(type, "Type to fetch must not be null");
String keyspace = resolveKeySpace(type);
potentiallyPublishEvent(KeyValueEvent.beforeGet(id, keyspace, type));
T result = execute(adapter -> {
Object value = adapter.get(id, keyspace, type);
if (value == null || typeCheck(type, value)) {
return type.cast(value);
}
return null;
});
potentiallyPublishEvent(KeyValueEvent.afterGet(id, keyspace, type, result));
return Optional.ofNullable(result);
}
@Override
public void delete(Class<?> type) {
Assert.notNull(type, "Type to delete must not be null");
String keyspace = resolveKeySpace(type);
potentiallyPublishEvent(KeyValueEvent.beforeDropKeySpace(keyspace, type));
execute((KeyValueCallback<Void>) adapter -> {
adapter.deleteAllOf(keyspace);
return null;
});
potentiallyPublishEvent(KeyValueEvent.afterDropKeySpace(keyspace, type));
}
@SuppressWarnings("unchecked")
@Override
public <T> T delete(T objectToDelete) {
Class<T> type = (Class<T>) ClassUtils.getUserClass(objectToDelete);
KeyValuePersistentEntity<?, ?> entity = getKeyValuePersistentEntity(objectToDelete);
Object id = entity.getIdentifierAccessor(objectToDelete).getIdentifier();
if (id == null) {
String error = String.format("Cannot determine id for type %s", ClassUtils.getUserClass(objectToDelete));
throw new InvalidDataAccessApiUsageException(error);
}
return delete(id, type);
}
@Override
public <T> T delete(Object id, Class<T> type) {
Assert.notNull(id, "Id for object to be deleted must not be null");
Assert.notNull(type, "Type to delete must not be null");
String keyspace = resolveKeySpace(type);
potentiallyPublishEvent(KeyValueEvent.beforeDelete(id, keyspace, type));
T result = execute(adapter -> adapter.delete(id, keyspace, type));
potentiallyPublishEvent(KeyValueEvent.afterDelete(id, keyspace, type, result));
return result;
}
@Nullable
@Override
public <T> T execute(KeyValueCallback<T> action) {
Assert.notNull(action, "KeyValueCallback must not be null");
try {
return action.doInKeyValue(this.adapter);
} catch (RuntimeException e) {
throw resolveExceptionIfPossible(e);
}
}
protected <T> T executeRequired(KeyValueCallback<T> action) {
T result = execute(action);
if (result != null) {
return result;
}
throw new IllegalStateException(String.format("KeyValueCallback %s returned null value", action));
}
@Override
public <T> Iterable<T> find(KeyValueQuery<?> query, Class<T> type) {
return executeRequired((KeyValueCallback<Iterable<T>>) adapter -> {
Iterable<?> result = adapter.find(query, resolveKeySpace(type), type);
List<T> filtered = new ArrayList<>();
for (Object candidate : result) {
if (typeCheck(type, candidate)) {
filtered.add(type.cast(candidate));
}
}
return filtered;
});
}
@Override
public <T> Iterable<T> findAll(Class<T> type) {
Assert.notNull(type, "Type to fetch must not be null");
return executeRequired(adapter -> {
Iterable<?> values = adapter.getAllOf(resolveKeySpace(type), type);
ArrayList<T> filtered = new ArrayList<>();
for (Object candidate : values) {
if (typeCheck(type, candidate)) {
filtered.add(type.cast(candidate));
}
}
return filtered;
});
}
@SuppressWarnings("rawtypes")
@Override
public <T> Iterable<T> findAll(Sort sort, Class<T> type) {
return find(new KeyValueQuery(sort), type);
}
@SuppressWarnings("rawtypes")
@Override
public <T> Iterable<T> findInRange(long offset, int rows, Class<T> type) {
return find(new KeyValueQuery().skip(offset).limit(rows), type);
}
@SuppressWarnings("rawtypes")
@Override
public <T> Iterable<T> findInRange(long offset, int rows, Sort sort, Class<T> type) {
return find(new KeyValueQuery(sort).skip(offset).limit(rows), type);
}
@Override
public long count(Class<?> type) {
Assert.notNull(type, "Type for count must not be null");
return adapter.count(resolveKeySpace(type));
}
@Override
public long count(KeyValueQuery<?> query, Class<?> type) {
return executeRequired(adapter -> adapter.count(query, resolveKeySpace(type)));
}
@Override
public boolean exists(KeyValueQuery<?> query, Class<?> type) {
return executeRequired(adapter -> adapter.exists(query, resolveKeySpace(type)));
}
@Override
public MappingContext<?, ?> getMappingContext() {
return this.mappingContext;
}
@Override
public KeyValueAdapter getKeyValueAdapter() {
return adapter;
}
@Override
public void destroy() throws Exception {
this.adapter.destroy();
}
private KeyValuePersistentEntity<?, ?> getKeyValuePersistentEntity(Object objectToInsert) {
return this.mappingContext.getRequiredPersistentEntity(ClassUtils.getUserClass(objectToInsert));
}
private String resolveKeySpace(Class<?> type) {
return this.mappingContext.getRequiredPersistentEntity(type).getKeySpace();
}
private RuntimeException resolveExceptionIfPossible(RuntimeException e) {
DataAccessException translatedException = exceptionTranslator.translateExceptionIfPossible(e);
return translatedException != null ? translatedException : e;
}
@SuppressWarnings("rawtypes")
private void potentiallyPublishEvent(KeyValueEvent event) {
if (eventPublisher == null) {
return;
}
if (publishEvents && (eventTypesToPublish.isEmpty() || eventTypesToPublish.contains(event.getClass()))) {
eventPublisher.publishEvent(event);
}
}
}

View File

@ -0,0 +1,98 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.keyvalue.core.IdentifierGenerator;
import org.springframework.data.util.TypeInformation;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
/**
* Default implementation of {@link IdentifierGenerator} to generate identifiers of types {@link UUID}.
*/
enum DefaultIdentifierGenerator implements IdentifierGenerator {
INSTANCE;
private final AtomicReference<SecureRandom> secureRandom = new AtomicReference<>(null);
@Override
@SuppressWarnings("unchecked")
public <T> T generateIdentifierOfType(TypeInformation<T> identifierType) {
Class<?> type = identifierType.getType();
if (ClassUtils.isAssignable(UUID.class, type)) {
return (T) UUID.randomUUID();
} else if (ClassUtils.isAssignable(String.class, type)) {
return (T) UUID.randomUUID().toString();
} else if (ClassUtils.isAssignable(Integer.class, type)) {
return (T) Integer.valueOf(getSecureRandom().nextInt());
} else if (ClassUtils.isAssignable(Long.class, type)) {
return (T) Long.valueOf(getSecureRandom().nextLong());
}
throw new InvalidDataAccessApiUsageException(
String.format("Identifier cannot be generated for %s; Supported types are: UUID, String, Integer, and Long",
identifierType.getType().getName()));
}
private SecureRandom getSecureRandom() {
SecureRandom secureRandom = this.secureRandom.get();
if (secureRandom != null) {
return secureRandom;
}
for (String algorithm : OsTools.secureRandomAlgorithmNames()) {
try {
secureRandom = SecureRandom.getInstance(algorithm);
} catch (NoSuchAlgorithmException e) {
// ignore and try next.
}
}
if (secureRandom == null) {
throw new InvalidDataAccessApiUsageException(
String.format("Could not create SecureRandom instance for one of the algorithms '%s'",
StringUtils.collectionToCommaDelimitedString(OsTools.secureRandomAlgorithmNames())));
}
this.secureRandom.compareAndSet(null, secureRandom);
return secureRandom;
}
private static class OsTools {
private static final String OPERATING_SYSTEM_NAME = System.getProperty("os.name").toLowerCase();
private static final List<String> SECURE_RANDOM_ALGORITHMS_LINUX_OSX_SOLARIS = Arrays.asList("NativePRNGBlocking",
"NativePRNGNonBlocking", "NativePRNG", "SHA1PRNG");
private static final List<String> SECURE_RANDOM_ALGORITHMS_WINDOWS = Arrays.asList("SHA1PRNG", "Windows-PRNG");
static List<String> secureRandomAlgorithmNames() {
return OPERATING_SYSTEM_NAME.contains("win") ? SECURE_RANDOM_ALGORITHMS_WINDOWS
: SECURE_RANDOM_ALGORITHMS_LINUX_OSX_SOLARIS;
}
}
}

View File

@ -0,0 +1,72 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import org.springframework.data.keyvalue.core.IdentifierGenerator;
import org.springframework.data.mapping.IdentifierAccessor;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.mapping.PersistentPropertyAccessor;
import org.springframework.util.Assert;
/**
* {@link IdentifierAccessor} adding a {@link #getOrGenerateIdentifier()} to automatically generate an identifier and
* set it on the underling bean instance.
*
* @see #getOrGenerateIdentifier()
*/
class GeneratingIdAccessor implements IdentifierAccessor {
private final PersistentPropertyAccessor<?> accessor;
private final PersistentProperty<?> identifierProperty;
private final IdentifierGenerator generator;
/**
* Creates a new {@link GeneratingIdAccessor} using the given {@link PersistentPropertyAccessor}, identifier property
* and {@link IdentifierGenerator}.
*
* @param accessor must not be {@literal null}.
* @param identifierProperty must not be {@literal null}.
* @param generator must not be {@literal null}.
*/
GeneratingIdAccessor(PersistentPropertyAccessor<?> accessor, PersistentProperty<?> identifierProperty,
IdentifierGenerator generator) {
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null");
Assert.notNull(identifierProperty, "Identifier property must not be null");
Assert.notNull(generator, "IdentifierGenerator must not be null");
this.accessor = accessor;
this.identifierProperty = identifierProperty;
this.generator = generator;
}
@Override
public Object getIdentifier() {
return accessor.getProperty(identifierProperty);
}
Object getOrGenerateIdentifier() {
Object existingIdentifier = getIdentifier();
if (existingIdentifier != null) {
return existingIdentifier;
}
Object generatedIdentifier = generator.generateIdentifierOfType(identifierProperty.getTypeInformation());
accessor.setProperty(identifierProperty, generatedIdentifier);
return generatedIdentifier;
}
}

View File

@ -0,0 +1,20 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import org.springframework.data.keyvalue.core.KeyValueAdapter;
public interface KeyValueAdapterResolver {
KeyValueAdapter resolve();
}

View File

@ -0,0 +1,223 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import com.fasterxml.jackson.core.JsonPointer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.utils.TypeRef;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.expression.spel.SpelNode;
import org.springframework.expression.spel.standard.SpelExpression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.util.Assert;
import java.util.Base64;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* A {@link org.springframework.data.keyvalue.core.KeyValueAdapter} implementation for MySQL.
*/
@SuppressWarnings("AbbreviationAsWordInName")
public class MySQLDaprKeyValueAdapter extends AbstractDaprKeyValueAdapter {
private static final String DELETE_BY_KEYSPACE_PATTERN = "delete from state where id LIKE '%s'";
private static final String SELECT_BY_KEYSPACE_PATTERN = "select value from state where id LIKE '%s'";
private static final String SELECT_BY_FILTER_PATTERN =
"select value from state where id LIKE '%s' and JSON_EXTRACT(value, %s) = %s";
private static final String COUNT_BY_KEYSPACE_PATTERN = "select count(*) as value from state where id LIKE '%s'";
private static final String COUNT_BY_FILTER_PATTERN =
"select count(*) as value from state where id LIKE '%s' and JSON_EXTRACT(value, %s) = %s";
private static final TypeRef<List<JsonNode>> FILTER_TYPE_REF = new TypeRef<>() {
};
private static final TypeRef<List<JsonNode>> COUNT_TYPE_REF = new TypeRef<>() {
};
private static final SpelExpressionParser PARSER = new SpelExpressionParser();
private static final JsonPointer VALUE_POINTER = JsonPointer.compile("/value");
private final DaprClient daprClient;
private final ObjectMapper mapper;
private final String stateStoreName;
private final String bindingName;
/**
* Constructs a {@link MySQLDaprKeyValueAdapter}.
*
* @param daprClient The Dapr client.
* @param mapper The object mapper.
* @param stateStoreName The state store name.
* @param bindingName The binding name.
*/
public MySQLDaprKeyValueAdapter(DaprClient daprClient, ObjectMapper mapper, String stateStoreName,
String bindingName) {
super(daprClient, stateStoreName);
Assert.notNull(mapper, "ObjectMapper must not be null");
Assert.hasText(bindingName, "State store binding must not be empty");
this.daprClient = daprClient;
this.mapper = mapper;
this.stateStoreName = stateStoreName;
this.bindingName = bindingName;
}
@Override
public <T> Iterable<T> getAllOf(String keyspace, Class<T> type) {
Assert.hasText(keyspace, "Keyspace must not be empty");
Assert.notNull(type, "Type must not be null");
String sql = createSql(SELECT_BY_KEYSPACE_PATTERN, keyspace);
List<JsonNode> result = queryUsingBinding(sql, FILTER_TYPE_REF);
return convertValues(result, type);
}
@Override
public void deleteAllOf(String keyspace) {
Assert.hasText(keyspace, "Keyspace must not be empty");
String sql = createSql(DELETE_BY_KEYSPACE_PATTERN, keyspace);
execUsingBinding(sql);
}
@Override
public <T> Iterable<T> find(KeyValueQuery<?> query, String keyspace, Class<T> type) {
Assert.notNull(query, "Query must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
Assert.notNull(type, "Type must not be null");
Object criteria = query.getCriteria();
if (criteria == null) {
return getAllOf(keyspace, type);
}
String sql = createSql(SELECT_BY_FILTER_PATTERN, keyspace, criteria);
List<JsonNode> result = queryUsingBinding(sql, FILTER_TYPE_REF);
return convertValues(result, type);
}
@Override
public long count(String keyspace) {
Assert.hasText(keyspace, "Keyspace must not be empty");
String sql = createSql(COUNT_BY_KEYSPACE_PATTERN, keyspace);
List<JsonNode> result = queryUsingBinding(sql, COUNT_TYPE_REF);
return extractCount(result);
}
@Override
public long count(KeyValueQuery<?> query, String keyspace) {
Assert.notNull(query, "Query must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
Object criteria = query.getCriteria();
if (criteria == null) {
return count(keyspace);
}
String sql = createSql(COUNT_BY_FILTER_PATTERN, keyspace, criteria);
List<JsonNode> result = queryUsingBinding(sql, COUNT_TYPE_REF);
return extractCount(result);
}
private String getKeyspaceFilter(String keyspace) {
return String.format("%s||%s-%%", stateStoreName, keyspace);
}
private String createSql(String sqlPattern, String keyspace) {
String keyspaceFilter = getKeyspaceFilter(keyspace);
return String.format(sqlPattern, keyspaceFilter);
}
private String createSql(String sqlPattern, String keyspace, Object criteria) {
String keyspaceFilter = getKeyspaceFilter(keyspace);
SpelExpression expression = PARSER.parseRaw(criteria.toString());
SpelNode leftNode = expression.getAST().getChild(0);
SpelNode rightNode = expression.getAST().getChild(1);
String left = String.format("'$.%s'", leftNode.toStringAST());
String right = rightNode.toStringAST();
return String.format(sqlPattern, keyspaceFilter, left, right);
}
private void execUsingBinding(String sql) {
Map<String, String> meta = Map.of("sql", sql);
daprClient.invokeBinding(bindingName, "exec", null, meta).block();
}
private <T> T queryUsingBinding(String sql, TypeRef<T> typeRef) {
Map<String, String> meta = Map.of("sql", sql);
return daprClient.invokeBinding(bindingName, "query", null, meta, typeRef).block();
}
private <T> List<T> convertValues(List<JsonNode> values, Class<T> type) {
if (values == null || values.isEmpty()) {
return Collections.emptyList();
}
return values.stream()
.map(value -> convertValue(value, type))
.collect(Collectors.toList());
}
private <T> T convertValue(JsonNode value, Class<T> type) {
JsonNode valueNode = value.at(VALUE_POINTER);
if (valueNode.isMissingNode()) {
throw new IllegalStateException("Value is missing");
}
try {
// The value is stored as a base64 encoded string and wrapped in quotes
// hence we need to remove the quotes and then decode
String rawValue = valueNode.toString().replace("\"", "");
byte[] decodedValue = Base64.getDecoder().decode(rawValue);
return mapper.readValue(decodedValue, type);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private long extractCount(List<JsonNode> values) {
if (values == null || values.isEmpty()) {
return 0;
}
JsonNode valueNode = values.get(0).at(VALUE_POINTER);
if (valueNode.isMissingNode()) {
throw new IllegalStateException("Count value is missing");
}
if (!valueNode.isNumber()) {
throw new IllegalStateException("Count value is not a number");
}
return valueNode.asLong();
}
}

View File

@ -0,0 +1,216 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.spring.data.repository.query.DaprPredicate;
import io.dapr.utils.TypeRef;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.expression.spel.SpelNode;
import org.springframework.expression.spel.standard.SpelExpression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.util.Assert;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* A {@link org.springframework.data.keyvalue.core.KeyValueAdapter} implementation for PostgreSQL.
*/
@SuppressWarnings("AbbreviationAsWordInName")
public class PostgreSQLDaprKeyValueAdapter extends AbstractDaprKeyValueAdapter {
private static final String DELETE_BY_KEYSPACE_PATTERN = "delete from state where key LIKE '%s'";
private static final String SELECT_BY_KEYSPACE_PATTERN = "select value from state where key LIKE '%s'";
private static final String SELECT_BY_FILTER_PATTERN =
"select value from state where key LIKE '%s' and JSONB_EXTRACT_PATH_TEXT(value, %s) = %s";
private static final String COUNT_BY_KEYSPACE_PATTERN = "select count(*) as value from state where key LIKE '%s'";
private static final String COUNT_BY_FILTER_PATTERN =
"select count(*) as value from state where key LIKE '%s' and JSONB_EXTRACT_PATH_TEXT(value, %s) = %s";
private static final TypeRef<List<List<Object>>> FILTER_TYPE_REF = new TypeRef<>() {
};
private static final TypeRef<List<List<Long>>> COUNT_TYPE_REF = new TypeRef<>() {
};
private static final SpelExpressionParser PARSER = new SpelExpressionParser();
private final DaprClient daprClient;
private final ObjectMapper mapper;
private final String stateStoreName;
private final String bindingName;
/**
* Constructs a {@link PostgreSQLDaprKeyValueAdapter}.
*
* @param daprClient The Dapr client.
* @param mapper The object mapper.
* @param stateStoreName The state store name.
* @param bindingName The binding name.
*/
public PostgreSQLDaprKeyValueAdapter(DaprClient daprClient, ObjectMapper mapper, String stateStoreName,
String bindingName) {
super(daprClient, stateStoreName);
Assert.notNull(mapper, "ObjectMapper must not be null");
Assert.hasText(bindingName, "State store binding must not be empty");
this.daprClient = daprClient;
this.mapper = mapper;
this.stateStoreName = stateStoreName;
this.bindingName = bindingName;
}
@Override
public <T> Iterable<T> getAllOf(String keyspace, Class<T> type) {
Assert.hasText(keyspace, "Keyspace must not be empty");
Assert.notNull(type, "Type must not be null");
String sql = createSql(SELECT_BY_KEYSPACE_PATTERN, keyspace);
List<List<Object>> result = queryUsingBinding(sql, FILTER_TYPE_REF);
return convertValues(result, type);
}
@Override
public void deleteAllOf(String keyspace) {
Assert.hasText(keyspace, "Keyspace must not be empty");
String sql = createSql(DELETE_BY_KEYSPACE_PATTERN, keyspace);
execUsingBinding(sql);
}
@Override
public <T> Iterable<T> find(KeyValueQuery<?> query, String keyspace, Class<T> type) {
Assert.notNull(query, "Query must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
Assert.notNull(type, "Type must not be null");
Object criteria = query.getCriteria();
if (criteria == null) {
return getAllOf(keyspace, type);
}
String sql = createSql(SELECT_BY_FILTER_PATTERN, keyspace, criteria);
List<List<Object>> result = queryUsingBinding(sql, FILTER_TYPE_REF);
return convertValues(result, type);
}
@Override
public long count(String keyspace) {
Assert.hasText(keyspace, "Keyspace must not be empty");
String sql = createSql(COUNT_BY_KEYSPACE_PATTERN, keyspace);
List<List<Long>> result = queryUsingBinding(sql, COUNT_TYPE_REF);
return extractCount(result);
}
@Override
public long count(KeyValueQuery<?> query, String keyspace) {
Assert.notNull(query, "Query must not be null");
Assert.hasText(keyspace, "Keyspace must not be empty");
Object criteria = query.getCriteria();
if (criteria == null) {
return count(keyspace);
}
String sql = createSql(COUNT_BY_FILTER_PATTERN, keyspace, criteria);
List<List<Long>> result = queryUsingBinding(sql, COUNT_TYPE_REF);
return extractCount(result);
}
private String getKeyspaceFilter(String keyspace) {
return String.format("%s||%s-%%", stateStoreName, keyspace);
}
private String createSql(String sqlPattern, String keyspace) {
String keyspaceFilter = getKeyspaceFilter(keyspace);
return String.format(sqlPattern, keyspaceFilter);
}
private String createSql(String sqlPattern, String keyspace, Object criteria) {
String keyspaceFilter = getKeyspaceFilter(keyspace);
if (criteria instanceof DaprPredicate) {
var daprPredicate = (DaprPredicate) criteria;
String path = daprPredicate.getPath().toString();
String pathWithOutType = String.format("'%s'", path.substring(path.indexOf(".") + 1));
String value = String.format("'%s'", daprPredicate.getValue().toString());
return String.format(sqlPattern, keyspaceFilter, pathWithOutType, value);
} else if (criteria instanceof String) {
SpelExpression expression = PARSER.parseRaw(criteria.toString());
SpelNode leftNode = expression.getAST().getChild(0);
SpelNode rightNode = expression.getAST().getChild(1);
String left = String.format("'%s'", leftNode.toStringAST());
String right = rightNode.toStringAST();
return String.format(sqlPattern, keyspaceFilter, left, right);
}
return null;
}
private void execUsingBinding(String sql) {
Map<String, String> meta = Map.of("sql", sql);
daprClient.invokeBinding(bindingName, "exec", null, meta).block();
}
private <T> T queryUsingBinding(String sql, TypeRef<T> typeRef) {
Map<String, String> meta = Map.of("sql", sql);
return daprClient.invokeBinding(bindingName, "query", null, meta, typeRef).block();
}
private <T> Iterable<T> convertValues(List<List<Object>> values, Class<T> type) {
if (values == null || values.isEmpty()) {
return Collections.emptyList();
}
return values.stream()
.flatMap(Collection::stream)
.map(value -> convertValue(value, type))
.collect(Collectors.toList());
}
private <T> T convertValue(Object value, Class<T> type) {
try {
return mapper.convertValue(value, type);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private long extractCount(List<List<Long>> values) {
if (values == null || values.isEmpty()) {
return 0;
}
return values.stream()
.flatMap(Collection::stream)
.collect(Collectors.toList())
.get(0);
}
}

View File

@ -0,0 +1,35 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.config;
import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;
import java.lang.annotation.Annotation;
/**
* Dapr specific {@link RepositoryBeanDefinitionRegistrarSupport} implementation.
*/
public class DaprRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport {
@Override
protected Class<? extends Annotation> getAnnotation() {
return EnableDaprRepositories.class;
}
@Override
protected RepositoryConfigurationExtension getExtension() {
return new DaprRepositoryConfigurationExtension();
}
}

View File

@ -0,0 +1,40 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.config;
import org.springframework.data.keyvalue.repository.config.KeyValueRepositoryConfigurationExtension;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;
/**
* {@link RepositoryConfigurationExtension} for Dapr-based repositories.
*/
@SuppressWarnings("unchecked")
public class DaprRepositoryConfigurationExtension extends KeyValueRepositoryConfigurationExtension {
@Override
public String getModuleName() {
return "Dapr";
}
@Override
protected String getModulePrefix() {
return "dapr";
}
@Override
protected String getDefaultKeyValueTemplateRef() {
return "daprKeyValueTemplate";
}
}

View File

@ -0,0 +1,139 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.config;
import io.dapr.spring.data.repository.query.DaprPredicateQueryCreator;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.repository.config.QueryCreatorType;
import org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactoryBean;
import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation to activate Dapr repositories. If no base package is configured through either {@link #value()},
* {@link #basePackages()} or {@link #basePackageClasses()} it will trigger scanning of the package of annotated class.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(DaprRepositoriesRegistrar.class)
@QueryCreatorType(DaprPredicateQueryCreator.class)
public @interface EnableDaprRepositories {
/**
* Alias for the {@link #basePackages()} attribute. Allows for more concise annotation declarations e.g.:
* {@code @EnableJpaRepositories("org.my.pkg")} instead of {@code @EnableJpaRepositories(basePackages="org.my.pkg")}.
*
* @return alias of the base package
*/
String[] value() default {};
/**
* Base packages to scan for annotated components. {@link #value()} is an alias for (and mutually exclusive with) this
* attribute. Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names.
*
* @return array of base packages
*/
String[] basePackages() default {};
/**
* Type-safe alternative to {@link #basePackages()} for specifying the packages to scan for annotated components. The
* package of each class specified will be scanned. Consider creating a special no-op marker class or interface in
* each package that serves no purpose other than being referenced by this attribute.
*
* @return array of base classes
*/
Class<?>[] basePackageClasses() default {};
/**
* Specifies which types are not eligible for component scanning.
*
* @return array of exclusion filters
*/
Filter[] excludeFilters() default {};
/**
* Specifies which types are eligible for component scanning. Further narrows the set of candidate components from
* everything in {@link #basePackages()} to everything in the base packages that matches the given filter or filters.
*
* @return array of inclusion filters
*/
Filter[] includeFilters() default {};
/**
* Returns the postfix to be used when looking up custom repository implementations. Defaults to {@literal Impl}. So
* for a repository named {@code PersonRepository} the corresponding implementation class will be looked up scanning
* for {@code PersonRepositoryImpl}.
*
* @return repository implementation post fix
*/
String repositoryImplementationPostfix() default "Impl";
/**
* Configures the location of where to find the Spring Data named queries properties file.
*
* @return named queries location
*/
String namedQueriesLocation() default "";
/**
* Returns the key of the {@link QueryLookupStrategy} to be used for lookup queries for query methods. Defaults to
* {@link Key#CREATE_IF_NOT_FOUND}.
*
* @return key lookup strategy
*/
Key queryLookupStrategy() default Key.CREATE_IF_NOT_FOUND;
/**
* Returns the {@link FactoryBean} class to be used for each repository instance. Defaults to
* {@link KeyValueRepositoryFactoryBean}.
*
* @return repository factory bean class
*/
Class<?> repositoryFactoryBeanClass() default KeyValueRepositoryFactoryBean.class;
/**
* Configure the repository base class to be used to create repository proxies for this particular configuration.
*
* @return repository base class
*/
Class<?> repositoryBaseClass() default DefaultRepositoryBaseClass.class;
/**
* Configures the name of the {@link KeyValueOperations} bean to be used with the repositories detected.
*
* @return the Key value template bean name
*/
String keyValueTemplateRef() default "daprKeyValueTemplate";
/**
* Configures whether nested repository-interfaces (e.g. defined as inner classes) should be discovered by the
* repositories infrastructure.
*
* @return whether to consider nested repository interfaces
*/
boolean considerNestedRepositories() default false;
}

View File

@ -0,0 +1,78 @@
/*
* Copyright 2021 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.query;
import org.springframework.beans.BeanWrapper;
import org.springframework.data.mapping.PropertyPath;
import org.springframework.data.util.DirectFieldAccessFallbackBeanWrapper;
import org.springframework.util.ObjectUtils;
import java.util.function.Function;
import java.util.function.Predicate;
public class DaprPredicate implements Predicate<Object> {
private final PropertyPath path;
private final Function<Object, Boolean> check;
private final Object value;
public DaprPredicate(PropertyPath path, Object expected) {
this(path, expected, (valueToCompare) -> ObjectUtils.nullSafeEquals(valueToCompare, expected));
}
/**
* Creates a new {@link DaprPredicate}.
*
* @param path The path to the property to compare.
* @param value The value to compare.
* @param check The function to check the value.
*/
public DaprPredicate(PropertyPath path, Object value, Function<Object, Boolean> check) {
this.path = path;
this.check = check;
this.value = value;
}
public PropertyPath getPath() {
return path;
}
public Object getValue() {
return value;
}
@Override
public boolean test(Object o) {
Object value = getValueByPath(o, path);
return check.apply(value);
}
private Object getValueByPath(Object root, PropertyPath path) {
Object currentValue = root;
for (PropertyPath currentPath : path) {
currentValue = wrap(currentValue).getPropertyValue(currentPath.getSegment());
if (currentValue == null) {
break;
}
}
return currentValue;
}
private BeanWrapper wrap(Object o) {
return new DirectFieldAccessFallbackBeanWrapper(o);
}
}

View File

@ -0,0 +1,182 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.query;
import org.springframework.data.repository.query.parser.Part;
import org.springframework.util.ObjectUtils;
import org.springframework.util.comparator.Comparators;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.function.Predicate;
import java.util.regex.Pattern;
class DaprPredicateBuilder {
private final Part part;
private DaprPredicateBuilder(Part part) {
this.part = part;
}
static DaprPredicateBuilder propertyValueOf(Part part) {
return new DaprPredicateBuilder(part);
}
Predicate<Object> isTrue() {
return new DaprPredicate(part.getProperty(), true);
}
public Predicate<Object> isFalse() {
return new DaprPredicate(part.getProperty(), false);
}
public Predicate<Object> isEqualTo(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
if ((o instanceof String) && (value instanceof String)) {
var s1 = (String)o;
var s2 = (String)value;
return s1.equalsIgnoreCase(s2);
}
}
return ObjectUtils.nullSafeEquals(o, value);
});
}
public Predicate<Object> isNull() {
return new DaprPredicate(part.getProperty(), null, Objects::isNull);
}
public Predicate<Object> isNotNull() {
return isNull().negate();
}
public Predicate<Object> isLessThan(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> Comparators.nullsHigh().compare(o, value) < 0);
}
public Predicate<Object> isLessThanEqual(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> Comparators.nullsHigh().compare(o, value) <= 0);
}
public Predicate<Object> isGreaterThan(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> Comparators.nullsHigh().compare(o, value) > 0);
}
public Predicate<Object> isGreaterThanEqual(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> Comparators.nullsHigh().compare(o, value) >= 0);
}
public Predicate<Object> matches(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (o == null || value == null) {
return ObjectUtils.nullSafeEquals(o, value);
}
if (value instanceof Pattern) {
var pattern = (Pattern)value;
return pattern.matcher(o.toString()).find();
}
return o.toString().matches(value.toString());
});
}
public Predicate<Object> in(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (value instanceof Collection<?>) {
var collection = (Collection<?>)value;
if (o instanceof Collection<?>) {
var subSet = (Collection<?>)o;
return collection.containsAll(subSet);
}
return collection.contains(o);
}
if (ObjectUtils.isArray(value)) {
return ObjectUtils.containsElement(ObjectUtils.toObjectArray(value), value);
}
return false;
});
}
public Predicate<Object> contains(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (o == null) {
return false;
}
if (o instanceof Collection<?>) {
var collection = (Collection<?>)o;
return collection.contains(value);
}
if (ObjectUtils.isArray(o)) {
return ObjectUtils.containsElement(ObjectUtils.toObjectArray(o), value);
}
if (o instanceof Map<?, ?>) {
var map = (Map<?, ?>)o;
return map.containsValue(value);
}
if (value == null) {
return false;
}
String s = o.toString();
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
return s.contains(value.toString());
}
return s.toLowerCase().contains(value.toString().toLowerCase());
});
}
public Predicate<Object> startsWith(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!(o instanceof String)) {
return false;
}
var s = (String)o;
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
return s.startsWith(value.toString());
}
return s.toLowerCase().startsWith(value.toString().toLowerCase());
});
}
public Predicate<Object> endsWith(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!(o instanceof String)) {
return false;
}
var s = (String)o;
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
return s.endsWith(value.toString());
}
return s.toLowerCase().endsWith(value.toString().toLowerCase());
});
}
}

View File

@ -0,0 +1,102 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.data.repository.query;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.domain.Sort;
import org.springframework.data.keyvalue.core.query.KeyValueQuery;
import org.springframework.data.repository.query.ParameterAccessor;
import org.springframework.data.repository.query.parser.AbstractQueryCreator;
import org.springframework.data.repository.query.parser.Part;
import org.springframework.data.repository.query.parser.PartTree;
import org.springframework.lang.Nullable;
import java.util.Iterator;
import java.util.function.Predicate;
/**
* This class is copied from https://github.com/spring-projects/spring-data-keyvalue/blob/ff441439124585042dd0cbff952f977a343444d2/src/main/java/org/springframework/data/keyvalue/repository/query/PredicateQueryCreator.java#L46
* because it has private accessors to internal classes, making it impossible to extend or use the original
* This requires to be created from scratch to not use predicates, but this is only worth it if we can prove these
* abstractions are worth the time.
*/
public class DaprPredicateQueryCreator extends AbstractQueryCreator<KeyValueQuery<Predicate<?>>, Predicate<?>> {
public DaprPredicateQueryCreator(PartTree tree, ParameterAccessor parameters) {
super(tree, parameters);
}
@Override
protected Predicate<?> create(Part part, Iterator<Object> iterator) {
DaprPredicateBuilder daprPredicateBuilder = DaprPredicateBuilder.propertyValueOf(part);
switch (part.getType()) {
case TRUE:
return daprPredicateBuilder.isTrue();
case FALSE:
return daprPredicateBuilder.isFalse();
case SIMPLE_PROPERTY:
return daprPredicateBuilder.isEqualTo(iterator.next());
case IS_NULL:
return daprPredicateBuilder.isNull();
case IS_NOT_NULL:
return daprPredicateBuilder.isNotNull();
case LIKE:
return daprPredicateBuilder.contains(iterator.next());
case STARTING_WITH:
return daprPredicateBuilder.startsWith(iterator.next());
case AFTER:
case GREATER_THAN:
return daprPredicateBuilder.isGreaterThan(iterator.next());
case GREATER_THAN_EQUAL:
return daprPredicateBuilder.isGreaterThanEqual(iterator.next());
case BEFORE:
case LESS_THAN:
return daprPredicateBuilder.isLessThan(iterator.next());
case LESS_THAN_EQUAL:
return daprPredicateBuilder.isLessThanEqual(iterator.next());
case ENDING_WITH:
return daprPredicateBuilder.endsWith(iterator.next());
case BETWEEN:
return daprPredicateBuilder.isGreaterThan(iterator.next())
.and(daprPredicateBuilder.isLessThan(iterator.next()));
case REGEX:
return daprPredicateBuilder.matches(iterator.next());
case IN:
return daprPredicateBuilder.in(iterator.next());
default:
throw new InvalidDataAccessApiUsageException(String.format("Found invalid part '%s' in query", part.getType()));
}
}
@Override
protected Predicate<?> and(Part part, Predicate<?> base, Iterator<Object> iterator) {
return base.and((Predicate) create(part, iterator));
}
@Override
protected Predicate<?> or(Predicate<?> base, Predicate<?> criteria) {
return base.or((Predicate) criteria);
}
@Override
protected KeyValueQuery<Predicate<?>> complete(@Nullable Predicate<?> criteria, Sort sort) {
if (criteria == null) {
return new KeyValueQuery<>(it -> true, sort);
}
return new KeyValueQuery<>(criteria, sort);
}
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
</parent>
<artifactId>dapr-spring-messaging</artifactId>
<name>dapr-spring-messaging</name>
<description>Dapr Spring Messaging</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,66 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging;
import reactor.core.publisher.Mono;
public interface DaprMessagingOperations<T> {
/**
* Sends a message to the specified topic in a blocking manner.
*
* @param topic the topic to send the message to or {@code null} to send to the
* default topic
* @param message the message to send
*/
void send(String topic, T message);
/**
* Create a {@link SendMessageBuilder builder} for configuring and sending a message.
*
* @param message the payload of the message
* @return the builder to configure and send the message
*/
SendMessageBuilder<T> newMessage(T message);
/**
* Builder that can be used to configure and send a message. Provides more options
* than the basic send/sendAsync methods provided by {@link DaprMessagingOperations}.
*
* @param <T> the message payload type
*/
interface SendMessageBuilder<T> {
/**
* Specify the topic to send the message to.
*
* @param topic the destination topic
* @return the current builder with the destination topic specified
*/
SendMessageBuilder<T> withTopic(String topic);
/**
* Send the message in a blocking manner using the configured specification.
*/
void send();
/**
* Uses the configured specification to send the message in a non-blocking manner.
*
* @return a Mono that completes when the message has been sent
*/
Mono<Void> sendAsync();
}
}

View File

@ -0,0 +1,205 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging;
import io.dapr.client.DaprClient;
import io.dapr.client.domain.Metadata;
import io.dapr.spring.messaging.observation.DaprMessagingObservationConvention;
import io.dapr.spring.messaging.observation.DaprMessagingObservationDocumentation;
import io.dapr.spring.messaging.observation.DaprMessagingSenderContext;
import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import reactor.core.publisher.Mono;
import reactor.util.context.Context;
import javax.annotation.Nullable;
import java.util.Map;
/**
* Create a new DaprMessagingTemplate.
* @param <T> templated message type
*/
public class DaprMessagingTemplate<T> implements DaprMessagingOperations<T>, ApplicationContextAware, BeanNameAware,
SmartInitializingSingleton {
private static final Logger LOGGER = LoggerFactory.getLogger(DaprMessagingTemplate.class);
private static final String MESSAGE_TTL_IN_SECONDS = "10";
private static final DaprMessagingObservationConvention DEFAULT_OBSERVATION_CONVENTION =
DaprMessagingObservationConvention.getDefault();
private final DaprClient daprClient;
private final String pubsubName;
private final Map<String, String> metadata;
private final boolean observationEnabled;
@Nullable
private ApplicationContext applicationContext;
@Nullable
private String beanName;
@Nullable
private ObservationRegistry observationRegistry;
@Nullable
private DaprMessagingObservationConvention observationConvention;
/**
* Constructs a new DaprMessagingTemplate.
* @param daprClient Dapr client
* @param pubsubName pubsub name
* @param observationEnabled whether to enable observations
*/
public DaprMessagingTemplate(DaprClient daprClient, String pubsubName, boolean observationEnabled) {
this.daprClient = daprClient;
this.pubsubName = pubsubName;
this.metadata = Map.of(Metadata.TTL_IN_SECONDS, MESSAGE_TTL_IN_SECONDS);
this.observationEnabled = observationEnabled;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@Override
public void setBeanName(String beanName) {
this.beanName = beanName;
}
/**
* If observations are enabled, attempt to obtain the Observation registry and
* convention.
*/
@Override
public void afterSingletonsInstantiated() {
if (!observationEnabled) {
LOGGER.debug("Observations are not enabled - not recording");
return;
}
if (applicationContext == null) {
LOGGER.warn("Observations enabled but application context null - not recording");
return;
}
observationRegistry = applicationContext.getBeanProvider(ObservationRegistry.class)
.getIfUnique(() -> observationRegistry);
observationConvention = applicationContext.getBeanProvider(DaprMessagingObservationConvention.class)
.getIfUnique(() -> observationConvention);
}
@Override
public void send(String topic, T message) {
doSend(topic, message);
}
@Override
public SendMessageBuilder<T> newMessage(T message) {
return new DefaultSendMessageBuilder<>(this, message);
}
private void doSend(String topic, T message) {
doSendAsync(topic, message).block();
}
private Mono<Void> doSendAsync(String topic, T message) {
LOGGER.trace("Sending message to '{}' topic", topic);
if (canUseObservation()) {
return publishEventWithObservation(pubsubName, topic, message);
}
return publishEvent(pubsubName, topic, message);
}
private boolean canUseObservation() {
return observationEnabled && observationRegistry != null && beanName != null;
}
private Mono<Void> publishEvent(String pubsubName, String topic, T message) {
return daprClient.publishEvent(pubsubName, topic, message, metadata);
}
private Mono<Void> publishEventWithObservation(String pubsubName, String topic, T message) {
DaprMessagingSenderContext senderContext = DaprMessagingSenderContext.newContext(topic, this.beanName);
Observation observation = createObservation(senderContext);
observation.start();
return publishEvent(pubsubName, topic, message)
.contextWrite(getReactorContext(senderContext))
.doOnError(err -> {
LOGGER.error("Failed to send msg to '{}' topic", topic, err);
observation.error(err);
observation.stop();
})
.doOnSuccess(ignore -> {
LOGGER.trace("Sent msg to '{}' topic", topic);
observation.stop();
});
}
private Context getReactorContext(DaprMessagingSenderContext senderContext) {
return Context.of(senderContext.properties());
}
private Observation createObservation(DaprMessagingSenderContext senderContext) {
return DaprMessagingObservationDocumentation.TEMPLATE_OBSERVATION.observation(
observationConvention,
DEFAULT_OBSERVATION_CONVENTION,
() -> senderContext,
observationRegistry
);
}
private static class DefaultSendMessageBuilder<T> implements SendMessageBuilder<T> {
private final DaprMessagingTemplate<T> template;
private final T message;
private String topic;
DefaultSendMessageBuilder(DaprMessagingTemplate<T> template, T message) {
this.template = template;
this.message = message;
}
@Override
public SendMessageBuilder<T> withTopic(String topic) {
this.topic = topic;
return this;
}
@Override
public void send() {
template.doSend(topic, message);
}
@Override
public Mono<Void> sendAsync() {
return template.doSendAsync(topic, message);
}
}
}

View File

@ -0,0 +1,39 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging.observation;
import io.micrometer.observation.Observation.Context;
import io.micrometer.observation.ObservationConvention;
/**
* {@link ObservationConvention} for Dapr Messaging.
*
*/
public interface DaprMessagingObservationConvention extends ObservationConvention<DaprMessagingSenderContext> {
@Override
default boolean supportsContext(Context context) {
return context instanceof DaprMessagingSenderContext;
}
@Override
default String getName() {
return "spring.dapr.messaging.template";
}
static DaprMessagingObservationConvention getDefault() {
return DefaultDaprMessagingObservationConvention.INSTANCE;
}
}

View File

@ -0,0 +1,64 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging.observation;
import io.micrometer.common.docs.KeyName;
import io.micrometer.observation.Observation;
import io.micrometer.observation.Observation.Context;
import io.micrometer.observation.ObservationConvention;
import io.micrometer.observation.docs.ObservationDocumentation;
/**
* An {@link Observation} for {@link io.dapr.spring.messaging.DaprMessagingTemplate}.
*
*/
public enum DaprMessagingObservationDocumentation implements ObservationDocumentation {
/**
* Observation created when a Dapr template sends a message.
*/
TEMPLATE_OBSERVATION {
@Override
public Class<? extends ObservationConvention<? extends Context>> getDefaultConvention() {
return DefaultDaprMessagingObservationConvention.class;
}
@Override
public String getPrefix() {
return "spring.dapr.messaging.template";
}
@Override
public KeyName[] getLowCardinalityKeyNames() {
return TemplateLowCardinalityTags.values();
}
};
/**
* Low cardinality tags.
*/
public enum TemplateLowCardinalityTags implements KeyName {
/**
* Bean name of the template that sent the message.
*/
BEAN_NAME {
@Override
public String asString() {
return "spring.dapr.messaging.template.name";
}
}
}
}

View File

@ -0,0 +1,96 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging.observation;
import io.micrometer.observation.transport.SenderContext;
import java.util.HashMap;
import java.util.Map;
/**
* {@link SenderContext} for Dapr Messaging.
*
*/
public final class DaprMessagingSenderContext extends SenderContext<DaprMessagingSenderContext.Carrier> {
private final String beanName;
private final String destination;
private DaprMessagingSenderContext(Carrier dataHolder, String topic, String beanName) {
super((carrier, key, value) -> dataHolder.property(key, value));
setCarrier(dataHolder);
this.beanName = beanName;
this.destination = topic;
}
/**
* Create a new context.
* @param topic topic to be used
* @param beanName name of the bean used usually (typically a {@code DaprMessagingTemplate})
* @return DaprMessageSenderContext
*/
public static DaprMessagingSenderContext newContext(String topic, String beanName) {
Carrier carrier = new Carrier();
return new DaprMessagingSenderContext(carrier, topic, beanName);
}
/**
* The properties of the message.
* @return the properties of the message
*/
public Map<String, String> properties() {
Carrier carrier = getCarrier();
if (carrier == null) {
return Map.of();
}
return carrier.properties();
}
/**
* The name of the bean sending the message (typically a {@code DaprMessagingTemplate}).
* @return the name of the bean sending the message
*/
public String getBeanName() {
return this.beanName;
}
/**
* The destination topic for the message.
* @return the topic the message is being sent to
*/
public String getDestination() {
return this.destination;
}
/**
* Acts as a carrier for a Dapr message and records the propagated properties for
* later access by the Dapr.
*/
public static final class Carrier {
private final Map<String, String> properties = new HashMap<>();
private Carrier() {
}
public void property(String key, String value) {
this.properties.put(key, value);
}
public Map<String, String> properties() {
return Map.copyOf(this.properties);
}
}
}

View File

@ -0,0 +1,47 @@
/*
* Copyright 2024 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.messaging.observation;
import io.micrometer.common.KeyValues;
/**
* Default {@link DefaultDaprMessagingObservationConvention} for Dapr template key values.
*
*/
class DefaultDaprMessagingObservationConvention implements DaprMessagingObservationConvention {
/**
* A singleton instance of the convention.
*/
public static final DefaultDaprMessagingObservationConvention INSTANCE =
new DefaultDaprMessagingObservationConvention();
@Override
public KeyValues getLowCardinalityKeyValues(DaprMessagingSenderContext context) {
return KeyValues.of(DaprMessagingObservationDocumentation.TemplateLowCardinalityTags.BEAN_NAME.asString(),
context.getBeanName());
}
// Remove once addressed:
// https://github.com/micrometer-metrics/micrometer-docs-generator/issues/30
@Override
public String getName() {
return "spring.dapr.messaging.template";
}
@Override
public String getContextualName(DaprMessagingSenderContext context) {
return context.getDestination() + " send";
}
}

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
</parent>
<artifactId>dapr-spring-workflows</artifactId>
<name>dapr-spring-workflows</name>
<description>Dapr Spring Workflows</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-workflows</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,71 @@
/*
* Copyright 2021 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.workflows.config;
import io.dapr.workflows.Workflow;
import io.dapr.workflows.WorkflowActivity;
import io.dapr.workflows.runtime.WorkflowRuntime;
import io.dapr.workflows.runtime.WorkflowRuntimeBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import java.util.Map;
@Configuration
public class DaprWorkflowsConfiguration implements ApplicationContextAware {
private static final Logger LOGGER = LoggerFactory.getLogger(DaprWorkflowsConfiguration.class);
private final WorkflowRuntimeBuilder workflowRuntimeBuilder;
public DaprWorkflowsConfiguration(WorkflowRuntimeBuilder workflowRuntimeBuilder) {
this.workflowRuntimeBuilder = workflowRuntimeBuilder;
}
/**
* Register workflows and activities to the workflowRuntimeBuilder.
* @param applicationContext Spring Application Context
*/
private void registerWorkflowsAndActivities(ApplicationContext applicationContext) {
LOGGER.info("Registering Dapr Workflows and Activities");
Map<String, Workflow> workflowBeans = applicationContext.getBeansOfType(Workflow.class);
for (Workflow workflow : workflowBeans.values()) {
LOGGER.info("Dapr Workflow: '{}' registered", workflow.getClass().getName());
workflowRuntimeBuilder.registerWorkflow(workflow);
}
Map<String, WorkflowActivity> workflowActivitiesBeans = applicationContext.getBeansOfType(WorkflowActivity.class);
for (WorkflowActivity activity : workflowActivitiesBeans.values()) {
LOGGER.info("Dapr Workflow Activity: '{}' registered", activity.getClass().getName());
workflowRuntimeBuilder.registerActivity(activity);
}
WorkflowRuntime runtime = workflowRuntimeBuilder.build();
LOGGER.info("Starting workflow runtime ... ");
runtime.start(false);
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
registerWorkflowsAndActivities(applicationContext);
}
}

View File

@ -0,0 +1,28 @@
/*
* Copyright 2021 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/
package io.dapr.spring.workflows.config;
import org.springframework.context.annotation.Import;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target(TYPE)
@Import(DaprWorkflowsConfiguration.class)
public @interface EnableDaprWorkflows {
}

255
dapr-spring/pom.xml Normal file
View File

@ -0,0 +1,255 @@
<project
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-parent</artifactId>
<version>1.16.0-SNAPSHOT</version>
</parent>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-parent</artifactId>
<packaging>pom</packaging>
<version>0.16.0-SNAPSHOT</version>
<name>dapr-spring-parent</name>
<description>SDK extension for Spring and Spring Boot</description>
<modules>
<module>dapr-spring-data</module>
<module>dapr-spring-messaging</module>
<module>dapr-spring-workflows</module>
<module>dapr-spring-boot-autoconfigure</module>
<module>dapr-spring-boot-tests</module>
<module>dapr-spring-boot-starters/dapr-spring-boot-starter</module>
<module>dapr-spring-boot-starters/dapr-spring-boot-starter-test</module>
</modules>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<testcontainers.version>1.19.8</testcontainers.version>
<junit.version>5.11.2</junit.version>
<dapr.spring.version>0.16.0-SNAPSHOT</dapr.spring.version>
<springboot.version>3.2.6</springboot.version>
<springframework.version>6.1.20</springframework.version>
<logback-core.version>1.4.14</logback-core.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${springboot.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>${dapr.sdk.version}</version>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-actors</artifactId>
<version>${dapr.sdk.version}</version>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-workflows</artifactId>
<version>${dapr.sdk.alpha.version}</version>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-data</artifactId>
<version>${dapr.spring.version}</version>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-messaging</artifactId>
<version>${dapr.spring.version}</version>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-workflows</artifactId>
<version>${dapr.spring.version}</version>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
<version>${dapr.spring.version}</version>
</dependency>
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-springboot</artifactId>
<version>${dapr.sdk.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-tests</artifactId>
<version>${dapr.spring.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${springboot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback-core.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>target/jacoco-report/</outputDirectory>
</configuration>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<includes>
<include>io.dapr.springboot.DaprBeanPostProcessor</include>
</includes>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>80%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,11 @@
<FindBugsFilter>
<Match>
<Package name="~io\.dapr\.spring.*"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Package name="~io\.dapr\.spring.*"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>

View File

@ -21,3 +21,7 @@ The `daprdocs` directory contains the markdown files that are rendered into the
- All rules in the [docs guide]({{< ref contributing-docs.md >}}) should be followed in addition to these.
- All files and directories should be prefixed with `java-` to ensure all file/directory names are globally unique across all Dapr documentation.
## Github Dapr Bot Commands
Checkout the [daprbot documentation](https://docs.dapr.io/contributing/daprbot/) for Github commands you can run in this repo for common tasks. For example, you can run the `/assign` (as a comment on an issue) to assign the issue to yourself.

View File

@ -4,9 +4,16 @@ title: "Dapr Java SDK"
linkTitle: "Java"
weight: 1000
description: Java SDK packages for developing Dapr applications
cascade:
github_repo: https://github.com/dapr/java-sdk
github_subdir: daprdocs/content/en/java-sdk-docs
path_base_for_github_subdir: content/en/developing-applications/sdks/java/
github_branch: master
---
## Pre-requisites
Dapr offers a variety of packages to help with the development of Java applications. Using them you can create Java clients, servers, and virtual actors with Dapr.
## Prerequisites
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
@ -19,9 +26,17 @@ description: Java SDK packages for developing Dapr applications
- [Maven 3.x](https://maven.apache.org/install.html)
- [Gradle 6.x](https://gradle.org/install/)
## Importing Dapr's Java SDK
## Import Dapr's Java SDK
Next, import the Java SDK packages to get started. Select your preferred build tool to learn how to import.
{{< tabs Maven Gradle >}}
{{% codetab %}}
<!--Maven-->
For a Maven project, add the following to your `pom.xml` file:
```xml
<project>
...
@ -31,25 +46,29 @@ For a Maven project, add the following to your `pom.xml` file:
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
<!-- Dapr's SDK for Actors (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-actors</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
<!-- Dapr's SDK integration with SpringBoot (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-springboot</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
...
</dependencies>
...
</project>
```
{{% /codetab %}}
{{% codetab %}}
<!--Gradle-->
For a Gradle project, add the following to your `build.gradle` file:
@ -57,128 +76,38 @@ 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.3.1')
compile('io.dapr:dapr-sdk:1.14.1')
// Dapr's SDK for Actors (optional).
compile('io.dapr:dapr-sdk-actors:1.3.1')
compile('io.dapr:dapr-sdk-actors:1.14.1')
// Dapr's SDK integration with SpringBoot (optional).
compile('io.dapr:dapr-sdk-springboot:1.3.1')
compile('io.dapr:dapr-sdk-springboot:1.14.1')
}
```
If you are also using Spring Boot, you may run into a common issue where the OkHttp version that the Dapr SDK uses conflicts with the one specified in the Spring Boot _Bill of Materials_.
You can fix this by specifying a compatible OkHttp version in your project to match the version that the Dapr SDK uses:
{{% /codetab %}}
{{< /tabs >}}
If you are also using Spring Boot, you may run into a common issue where the `OkHttp` version that the Dapr SDK uses conflicts with the one specified in the Spring Boot _Bill of Materials_.
You can fix this by specifying a compatible `OkHttp` version in your project to match the version that the Dapr SDK uses:
```xml
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>1.3.1</version>
<version>1.14.1</version>
</dependency>
```
## Building blocks
## Try it out
The Java SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}).
Put the Dapr Java SDK to the test. Walk through the Java quickstarts and tutorials to see Dapr in action:
### Invoke a service
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// invoke a 'GET' method (HTTP) skipping serialization: \say with a Mono<byte[]> return type
// for gRPC set HttpExtension.NONE parameters below
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"name\":\"World!\"}", HttpExtension.GET, byte[].class).block();
// invoke a 'POST' method (HTTP) skipping serialization: to \say with a Mono<byte[]> return type
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"id\":\"100\", \"FirstName\":\"Value\", \"LastName\":\"Value\"}", HttpExtension.POST, byte[].class).block();
System.out.println(new String(response));
// invoke a 'POST' method (HTTP) with serialization: \employees with a Mono<Employee> return type
Employee newEmployee = new Employee("Nigel", "Guitarist");
Employee employeeResponse = client.invokeMethod(SERVICE_TO_INVOKE, "employees", newEmployee, HttpExtension.POST, Employee.class).block();
}
```
- For a full guide on service invocation visit [How-To: Invoke a service]({{< ref howto-invoke-discover-services.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/invoke) for code samples and instructions to try out service invocation
### Save & get application state
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.State;
import reactor.core.publisher.Mono;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// Save state
client.saveState(STATE_STORE_NAME, FIRST_KEY_NAME, myClass).block();
// Get state
State<MyClass> retrievedMessage = client.getState(STATE_STORE_NAME, FIRST_KEY_NAME, MyClass.class).block();
// Delete state
client.deleteState(STATE_STORE_NAME, FIRST_KEY_NAME).block();
}
```
- For a full list of state operations visit [How-To: Get & save state]({{< ref howto-get-save-state.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/state) for code samples and instructions to try out state management
### Publish & subscribe to messages
##### Publish messages
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.Metadata;
import static java.util.Collections.singletonMap;
try (DaprClient client = (new DaprClientBuilder()).build()) {
client.publishEvent(PUBSUB_NAME, TOPIC_NAME, message, singletonMap(Metadata.TTL_IN_SECONDS, MESSAGE_TTL_IN_SECONDS)).block();
}
```
##### Subscribe to messages
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.Topic;
import io.dapr.client.domain.CloudEvent;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RestController
public class SubscriberController {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
@Topic(name = "testingtopic", pubsubName = "${myAppProperty:messagebus}")
@PostMapping(path = "/testingtopic")
public Mono<Void> handleMessage(@RequestBody(required = false) CloudEvent<?> cloudEvent) {
return Mono.fromRunnable(() -> {
try {
System.out.println("Subscriber got: " + cloudEvent.getData());
System.out.println("Subscriber got: " + OBJECT_MAPPER.writeValueAsString(cloudEvent));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
}
```
- For a full list of state operations visit [How-To: Publish & subscribe]({{< ref howto-publish-subscribe.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/pubsub/http) for code samples and instructions to try out pub/sub
### Interact with output bindings
| SDK samples | Description |
| ----------- | ----------- |
| [Quickstarts]({{< ref quickstarts >}}) | Experience Dapr's API building blocks in just a few minutes using the Java SDK. |
| [SDK samples](https://github.com/dapr/java-sdk/tree/master/examples) | Clone the SDK repo to try out some examples and get started. |
```java
import io.dapr.client.DaprClient;
@ -193,51 +122,24 @@ try (DaprClient client = (new DaprClientBuilder()).build()) {
}
```
- For a full guide on output bindings visit [How-To: Use bindings]({{< ref howto-bindings.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/bindings/http) for code samples and instructions to try out output bindings
- For a full guide on output bindings visit [How-To: Output bindings]({{< ref howto-bindings.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/bindings/http) for code samples and instructions to try out output bindings.
### Retrieve secrets
## Available packages
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import java.util.Map;
try (DaprClient client = (new DaprClientBuilder()).build()) {
Map<String, String> secret = client.getSecret(SECRET_STORE_NAME, secretKey).block();
System.out.println(JSON_SERIALIZER.writeValueAsString(secret));
}
```
- For a full guide on secrets visit [How-To: Retrieve secrets]({{< ref howto-secrets.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/secrets) for code samples and instructions to try out retrieving secrets
### Actors
An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the [Virtual Actor pattern](https://www.microsoft.com/en-us/research/project/orleans-virtual-actors/), which provides a single-threaded programming model and where actors are garbage collected when not in use. With Dapr's implementaiton, you write your Dapr actors according to the Actor model, and Dapr leverages the scalability and reliability that the underlying platform provides.
```java
import io.dapr.actors.ActorMethod;
import io.dapr.actors.ActorType;
import reactor.core.publisher.Mono;
@ActorType(name = "DemoActor")
public interface DemoActor {
void registerReminder();
@ActorMethod(name = "echo_message")
String say(String something);
void clock(String message);
@ActorMethod(returns = Integer.class)
Mono<Integer> incrementAndGet(int delta);
}
```
- For a full guide on actors visit [How-To: Use virtual actors in Dapr]({{< ref howto-actors.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors) for code samples and instructions to try actors
## Related links
- [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples)
<div class="card-deck">
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Client</b></h5>
<p class="card-text">Create Java clients that interact with a Dapr sidecar and other Dapr applications.</p>
<a href="{{< ref java-client >}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Workflow</b></h5>
<p class="card-text">Create and manage workflows that work with other Dapr APIs in Java.</p>
<a href="{{< ref workflow >}}" class="stretched-link"></a>
</div>
</div>
</div>

View File

@ -1,243 +0,0 @@
---
type: docs
title: "Dapr Java SDK"
linkTitle: "Java"
weight: 1000
description: Java SDK packages for developing Dapr applications
---
## Pre-requisites
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
- JDK 11 or above - the published jars are compatible with Java 8:
- [AdoptOpenJDK 11 - LTS](https://adoptopenjdk.net/)
- [Oracle's JDK 15](https://www.oracle.com/java/technologies/javase-downloads.html)
- [Oracle's JDK 11 - LTS](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
- [OpenJDK](https://openjdk.java.net/)
- Install one of the following build tools for Java:
- [Maven 3.x](https://maven.apache.org/install.html)
- [Gradle 6.x](https://gradle.org/install/)
## Importing Dapr's Java SDK
For a Maven project, add the following to your `pom.xml` file:
```xml
<project>
...
<dependencies>
...
<!-- Dapr's core SDK with all features, except Actors. -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Dapr's SDK for Actors (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-actors</artifactId>
<version>1.3.0</version>
</dependency>
<!-- Dapr's SDK integration with SpringBoot (optional). -->
<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-springboot</artifactId>
<version>1.3.0</version>
</dependency>
...
</dependencies>
...
</project>
```
For a Gradle project, add the following to your `build.gradle` file:
```java
dependencies {
...
// Dapr's core SDK with all features, except Actors.
compile('io.dapr:dapr-sdk:1.2.0')
// Dapr's SDK for Actors (optional).
compile('io.dapr:dapr-sdk-actors:1.2.0')
// Dapr's SDK integration with SpringBoot (optional).
compile('io.dapr:dapr-sdk-springboot:1.2.0')
}
```
If you are also using Spring Boot, you may run into a common issue where the OkHttp version that the Dapr SDK uses conflicts with the one specified in the Spring Boot _Bill of Materials_.
You can fix this by specifying a compatible OkHttp version in your project to match the version that the Dapr SDK uses:
```xml
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>1.3.0</version>
</dependency>
```
## Building blocks
The Java SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}).
### Invoke a service
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// invoke a 'GET' method (HTTP) skipping serialization: \say with a Mono<byte[]> return type
// for gRPC set HttpExtension.NONE parameters below
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"name\":\"World!\"}", HttpExtension.GET, byte[].class).block();
// invoke a 'POST' method (HTTP) skipping serialization: to \say with a Mono<byte[]> return type
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"id\":\"100\", \"FirstName\":\"Value\", \"LastName\":\"Value\"}", HttpExtension.POST, byte[].class).block();
System.out.println(new String(response));
// invoke a 'POST' method (HTTP) with serialization: \employees with a Mono<Employee> return type
Employee newEmployee = new Employee("Nigel", "Guitarist");
Employee employeeResponse = client.invokeMethod(SERVICE_TO_INVOKE, "employees", newEmployee, HttpExtension.POST, Employee.class).block();
}
```
- For a full guide on service invocation visit [How-To: Invoke a service]({{< ref howto-invoke-discover-services.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/invoke) for code samples and instructions to try out service invocation
### Save & get application state
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.State;
import reactor.core.publisher.Mono;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// Save state
client.saveState(STATE_STORE_NAME, FIRST_KEY_NAME, myClass).block();
// Get state
State<MyClass> retrievedMessage = client.getState(STATE_STORE_NAME, FIRST_KEY_NAME, MyClass.class).block();
// Delete state
client.deleteState(STATE_STORE_NAME, FIRST_KEY_NAME).block();
}
```
- For a full list of state operations visit [How-To: Get & save state]({{< ref howto-get-save-state.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/state) for code samples and instructions to try out state management
### Publish & subscribe to messages
##### Publish messages
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.Metadata;
import static java.util.Collections.singletonMap;
try (DaprClient client = (new DaprClientBuilder()).build()) {
client.publishEvent(PUBSUB_NAME, TOPIC_NAME, message, singletonMap(Metadata.TTL_IN_SECONDS, MESSAGE_TTL_IN_SECONDS)).block();
}
```
##### Subscribe to messages
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.Topic;
import io.dapr.client.domain.CloudEvent;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RestController
public class SubscriberController {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
@Topic(name = "testingtopic", pubsubName = "${myAppProperty:messagebus}")
@PostMapping(path = "/testingtopic")
public Mono<Void> handleMessage(@RequestBody(required = false) CloudEvent<?> cloudEvent) {
return Mono.fromRunnable(() -> {
try {
System.out.println("Subscriber got: " + cloudEvent.getData());
System.out.println("Subscriber got: " + OBJECT_MAPPER.writeValueAsString(cloudEvent));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
}
```
- For a full list of state operations visit [How-To: Publish & subscribe]({{< ref howto-publish-subscribe.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/pubsub/http) for code samples and instructions to try out pub/sub
### Interact with output bindings
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// sending a class with message; BINDING_OPERATION="create"
client.invokeBinding(BINDING_NAME, BINDING_OPERATION, myClass).block();
// sending a plain string
client.invokeBinding(BINDING_NAME, BINDING_OPERATION, message).block();
}
```
- For a full guide on output bindings visit [How-To: Use bindings]({{< ref howto-bindings.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/bindings/http) for code samples and instructions to try out output bindings
### Retrieve secrets
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import java.util.Map;
try (DaprClient client = (new DaprClientBuilder()).build()) {
Map<String, String> secret = client.getSecret(SECRET_STORE_NAME, secretKey).block();
System.out.println(JSON_SERIALIZER.writeValueAsString(secret));
}
```
- For a full guide on secrets visit [How-To: Retrieve secrets]({{< ref howto-secrets.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/secrets) for code samples and instructions to try out retrieving secrets
### Actors
An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the [Virtual Actor pattern](https://www.microsoft.com/en-us/research/project/orleans-virtual-actors/), which provides a single-threaded programming model and where actors are garbage collected when not in use. With Dapr's implementaiton, you write your Dapr actors according to the Actor model, and Dapr leverages the scalability and reliability that the underlying platform provides.
```java
import io.dapr.actors.ActorMethod;
import io.dapr.actors.ActorType;
import reactor.core.publisher.Mono;
@ActorType(name = "DemoActor")
public interface DemoActor {
void registerReminder();
@ActorMethod(name = "echo_message")
String say(String something);
void clock(String message);
@ActorMethod(returns = Integer.class)
Mono<Integer> incrementAndGet(int delta);
}
```
- For a full guide on actors visit [How-To: Use virtual actors in Dapr]({{< ref howto-actors.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors) for code samples and instructions to try actors
## Related links
- [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples)

View File

@ -0,0 +1,7 @@
---
type: docs
title: "AI"
linkTitle: "AI"
weight: 3000
description: With the Dapr Conversation AI package, you can interact with the Dapr AI workloads from a Java application. To get started, walk through the [Dapr AI]({{< ref java-ai-howto.md >}}) how-to guide.
---

View File

@ -0,0 +1,105 @@
---
type: docs
title: "How to: Author and manage Dapr Conversation AI in the Java SDK"
linkTitle: "How to: Author and manage Conversation AI"
weight: 20000
description: How to get up and running with Conversation AI using the Dapr Java SDK
---
As part of this demonstration, we will look at how to use the Conversation API to converse with a Large Language Model (LLM). The API
will return the response from the LLM for the given prompt. With the [provided conversation ai example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/conversation), you will:
- You will provide a prompt using the [Conversation AI example](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/conversation/DemoConversationAI.java)
- Filter out Personally identifiable information (PII).
This example uses the default configuration from `dapr init` in [self-hosted mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted).
## Prerequisites
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started).
- Java JDK 11 (or greater):
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads), or
- OpenJDK
- [Apache Maven](https://maven.apache.org/install.html), version 3.x.
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
## Set up the environment
Clone the [Java SDK repo](https://github.com/dapr/java-sdk) and navigate into it.
```bash
git clone https://github.com/dapr/java-sdk.git
cd java-sdk
```
Run the following command to install the requirements for running the Conversation AI example with the Dapr Java SDK.
```bash
mvn clean install -DskipTests
```
From the Java SDK root directory, navigate to the examples' directory.
```bash
cd examples
```
Run the Dapr sidecar.
```sh
dapr run --app-id conversationapp --dapr-grpc-port 51439 --dapr-http-port 3500 --app-port 8080
```
> Now, Dapr is listening for HTTP requests at `http://localhost:3500` and gRPC requests at `http://localhost:51439`.
## Send a prompt with Personally identifiable information (PII) to the Conversation AI API
In the `DemoConversationAI` there are steps to send a prompt using the `converse` method under the `DaprPreviewClient`.
```java
public class DemoConversationAI {
/**
* The main method to start the client.
*
* @param args Input arguments (unused).
*/
public static void main(String[] args) {
try (DaprPreviewClient client = new DaprClientBuilder().buildPreviewClient()) {
System.out.println("Sending the following input to LLM: Hello How are you? This is the my number 672-123-4567");
ConversationInput daprConversationInput = new ConversationInput("Hello How are you? "
+ "This is the my number 672-123-4567");
// Component name is the name provided in the metadata block of the conversation.yaml file.
Mono<ConversationResponse> responseMono = client.converse(new ConversationRequest("echo",
List.of(daprConversationInput))
.setContextId("contextId")
.setScrubPii(true).setTemperature(1.1d));
ConversationResponse response = responseMono.block();
System.out.printf("Conversation output: %s", response.getConversationOutputs().get(0).getResult());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
```
Run the `DemoConversationAI` with the following command.
```sh
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.conversation.DemoConversationAI
```
### Sample output
```
== APP == Conversation output: Hello How are you? This is the my number <ISBN>
```
As shown in the output, the number sent to the API is obfuscated and returned in the form of <ISBN>.
The example above uses an ["echo"](https://docs.dapr.io/developing-applications/building-blocks/conversation/howto-conversation-layer/#set-up-the-conversation-component)
component for testing, which simply returns the input message.
When integrated with LLMs like OpenAI or Claude, youll receive meaningful responses instead of echoed input.
## Next steps
- [Learn more about Conversation AI]({{< ref conversation-overview.md >}})
- [Conversation AI API reference]({{< ref conversation_api.md >}})

View File

@ -0,0 +1,638 @@
---
type: docs
title: "Getting started with the Dapr client Java SDK"
linkTitle: "Client"
weight: 3000
description: How to get up and running with the Dapr Java SDK
---
The Dapr client package allows you to interact with other Dapr applications from a Java application.
{{% alert title="Note" color="primary" %}}
If you haven't already, [try out one of the quickstarts]({{< ref quickstarts >}}) for a quick walk-through on how to use the Dapr Java SDK with an API building block.
{{% /alert %}}
## Prerequisites
[Complete initial setup and import the Java SDK into your project]({{< ref java >}})
## Initializing the client
You can initialize a Dapr client as so:
```java
DaprClient client = new DaprClientBuilder().build()
```
This will connect to the default Dapr gRPC endpoint `localhost:50001`. For information about configuring the client using environment variables and system properties, see [Properties]({{< ref properties.md >}}).
#### Error Handling
Initially, errors in Dapr followed the Standard gRPC error model. However, to provide more detailed and informative error
messages, in version 1.13 an enhanced error model has been introduced which aligns with the gRPC Richer error model. In
response, the Java SDK extended the DaprException to include the error details that were added in Dapr.
Example of handling the DaprException and consuming the error details when using the Dapr Java SDK:
```java
...
try {
client.publishEvent("unknown_pubsub", "mytopic", "mydata").block();
} catch (DaprException exception) {
System.out.println("Dapr exception's error code: " + exception.getErrorCode());
System.out.println("Dapr exception's message: " + exception.getMessage());
// DaprException now contains `getStatusDetails()` to include more details about the error from Dapr runtime.
System.out.println("Dapr exception's reason: " + exception.getStatusDetails().get(
DaprErrorDetails.ErrorDetailType.ERROR_INFO,
"reason",
TypeRef.STRING));
}
...
```
## Building blocks
The Java SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}).
### Invoke a service
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// invoke a 'GET' method (HTTP) skipping serialization: \say with a Mono<byte[]> return type
// for gRPC set HttpExtension.NONE parameters below
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"name\":\"World!\"}", HttpExtension.GET, byte[].class).block();
// invoke a 'POST' method (HTTP) skipping serialization: to \say with a Mono<byte[]> return type
response = client.invokeMethod(SERVICE_TO_INVOKE, METHOD_TO_INVOKE, "{\"id\":\"100\", \"FirstName\":\"Value\", \"LastName\":\"Value\"}", HttpExtension.POST, byte[].class).block();
System.out.println(new String(response));
// invoke a 'POST' method (HTTP) with serialization: \employees with a Mono<Employee> return type
Employee newEmployee = new Employee("Nigel", "Guitarist");
Employee employeeResponse = client.invokeMethod(SERVICE_TO_INVOKE, "employees", newEmployee, HttpExtension.POST, Employee.class).block();
}
```
- For a full guide on service invocation visit [How-To: Invoke a service]({{< ref howto-invoke-discover-services.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/invoke) for code samples and instructions to try out service invocation
### Save & get application state
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.State;
import reactor.core.publisher.Mono;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// Save state
client.saveState(STATE_STORE_NAME, FIRST_KEY_NAME, myClass).block();
// Get state
State<MyClass> retrievedMessage = client.getState(STATE_STORE_NAME, FIRST_KEY_NAME, MyClass.class).block();
// Delete state
client.deleteState(STATE_STORE_NAME, FIRST_KEY_NAME).block();
}
```
- For a full list of state operations visit [How-To: Get & save state]({{< ref howto-get-save-state.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/state) for code samples and instructions to try out state management
### Publish & subscribe to messages
##### Publish messages
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.domain.Metadata;
import static java.util.Collections.singletonMap;
try (DaprClient client = (new DaprClientBuilder()).build()) {
client.publishEvent(PUBSUB_NAME, TOPIC_NAME, message, singletonMap(Metadata.TTL_IN_SECONDS, MESSAGE_TTL_IN_SECONDS)).block();
}
```
##### Subscribe to messages
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.Topic;
import io.dapr.client.domain.BulkSubscribeAppResponse;
import io.dapr.client.domain.BulkSubscribeAppResponseEntry;
import io.dapr.client.domain.BulkSubscribeAppResponseStatus;
import io.dapr.client.domain.BulkSubscribeMessage;
import io.dapr.client.domain.BulkSubscribeMessageEntry;
import io.dapr.client.domain.CloudEvent;
import io.dapr.springboot.annotations.BulkSubscribe;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@RestController
public class SubscriberController {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
@Topic(name = "testingtopic", pubsubName = "${myAppProperty:messagebus}")
@PostMapping(path = "/testingtopic")
public Mono<Void> handleMessage(@RequestBody(required = false) CloudEvent<?> cloudEvent) {
return Mono.fromRunnable(() -> {
try {
System.out.println("Subscriber got: " + cloudEvent.getData());
System.out.println("Subscriber got: " + OBJECT_MAPPER.writeValueAsString(cloudEvent));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
@Topic(name = "testingtopic", pubsubName = "${myAppProperty:messagebus}",
rule = @Rule(match = "event.type == 'myevent.v2'", priority = 1))
@PostMapping(path = "/testingtopicV2")
public Mono<Void> handleMessageV2(@RequestBody(required = false) CloudEvent envelope) {
return Mono.fromRunnable(() -> {
try {
System.out.println("Subscriber got: " + cloudEvent.getData());
System.out.println("Subscriber got: " + OBJECT_MAPPER.writeValueAsString(cloudEvent));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
@BulkSubscribe()
@Topic(name = "testingtopicbulk", pubsubName = "${myAppProperty:messagebus}")
@PostMapping(path = "/testingtopicbulk")
public Mono<BulkSubscribeAppResponse> handleBulkMessage(
@RequestBody(required = false) BulkSubscribeMessage<CloudEvent<String>> bulkMessage) {
return Mono.fromCallable(() -> {
if (bulkMessage.getEntries().size() == 0) {
return new BulkSubscribeAppResponse(new ArrayList<BulkSubscribeAppResponseEntry>());
}
System.out.println("Bulk Subscriber received " + bulkMessage.getEntries().size() + " messages.");
List<BulkSubscribeAppResponseEntry> entries = new ArrayList<BulkSubscribeAppResponseEntry>();
for (BulkSubscribeMessageEntry<?> entry : bulkMessage.getEntries()) {
try {
System.out.printf("Bulk Subscriber message has entry ID: %s\n", entry.getEntryId());
CloudEvent<?> cloudEvent = (CloudEvent<?>) entry.getEvent();
System.out.printf("Bulk Subscriber got: %s\n", cloudEvent.getData());
entries.add(new BulkSubscribeAppResponseEntry(entry.getEntryId(), BulkSubscribeAppResponseStatus.SUCCESS));
} catch (Exception e) {
e.printStackTrace();
entries.add(new BulkSubscribeAppResponseEntry(entry.getEntryId(), BulkSubscribeAppResponseStatus.RETRY));
}
}
return new BulkSubscribeAppResponse(entries);
});
}
}
```
##### Bulk Publish Messages
> Note: API is in Alpha stage
```java
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.DaprPreviewClient;
import io.dapr.client.domain.BulkPublishResponse;
import io.dapr.client.domain.BulkPublishResponseFailedEntry;
import java.util.ArrayList;
import java.util.List;
class Solution {
public void publishMessages() {
try (DaprPreviewClient client = (new DaprClientBuilder()).buildPreviewClient()) {
// Create a list of messages to publish
List<String> messages = new ArrayList<>();
for (int i = 0; i < NUM_MESSAGES; i++) {
String message = String.format("This is message #%d", i);
messages.add(message);
System.out.println("Going to publish message : " + message);
}
// Publish list of messages using the bulk publish API
BulkPublishResponse<String> res = client.publishEvents(PUBSUB_NAME, TOPIC_NAME, "text/plain", messages).block()
}
}
}
```
- For a full guide on publishing messages and subscribing to a topic [How-To: Publish & subscribe]({{< ref howto-publish-subscribe.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/pubsub/http) for code samples and instructions to try out pub/sub
### Interact with output bindings
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
try (DaprClient client = (new DaprClientBuilder()).build()) {
// sending a class with message; BINDING_OPERATION="create"
client.invokeBinding(BINDING_NAME, BINDING_OPERATION, myClass).block();
// sending a plain string
client.invokeBinding(BINDING_NAME, BINDING_OPERATION, message).block();
}
```
- For a full guide on output bindings visit [How-To: Output bindings]({{< ref howto-bindings.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/bindings/http) for code samples and instructions to try out output bindings.
### Interact with input bindings
```java
import org.springframework.web.bind.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@RestController
@RequestMapping("/")
public class myClass {
private static final Logger log = LoggerFactory.getLogger(myClass);
@PostMapping(path = "/checkout")
public Mono<String> getCheckout(@RequestBody(required = false) byte[] body) {
return Mono.fromRunnable(() ->
log.info("Received Message: " + new String(body)));
}
}
```
- For a full guide on input bindings, visit [How-To: Input bindings]({{< ref howto-triggers >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/bindings/http) for code samples and instructions to try out input bindings.
### Retrieve secrets
```java
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import java.util.Map;
try (DaprClient client = (new DaprClientBuilder()).build()) {
Map<String, String> secret = client.getSecret(SECRET_STORE_NAME, secretKey).block();
System.out.println(JSON_SERIALIZER.writeValueAsString(secret));
}
```
- For a full guide on secrets visit [How-To: Retrieve secrets]({{< ref howto-secrets.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/secrets) for code samples and instructions to try out retrieving secrets
### Actors
An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the [Virtual Actor pattern](https://www.microsoft.com/en-us/research/project/orleans-virtual-actors/), which provides a single-threaded programming model and where actors are garbage collected when not in use. With Dapr's implementaiton, you write your Dapr actors according to the Actor model, and Dapr leverages the scalability and reliability that the underlying platform provides.
```java
import io.dapr.actors.ActorMethod;
import io.dapr.actors.ActorType;
import reactor.core.publisher.Mono;
@ActorType(name = "DemoActor")
public interface DemoActor {
void registerReminder();
@ActorMethod(name = "echo_message")
String say(String something);
void clock(String message);
@ActorMethod(returns = Integer.class)
Mono<Integer> incrementAndGet(int delta);
}
```
- For a full guide on actors visit [How-To: Use virtual actors in Dapr]({{< ref howto-actors.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors) for code samples and instructions to try actors
### Get & Subscribe to application configurations
> Note this is a preview API and thus will only be accessible via the DaprPreviewClient interface and not the normal DaprClient interface
```java
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.DaprPreviewClient;
import io.dapr.client.domain.ConfigurationItem;
import io.dapr.client.domain.GetConfigurationRequest;
import io.dapr.client.domain.SubscribeConfigurationRequest;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
try (DaprPreviewClient client = (new DaprClientBuilder()).buildPreviewClient()) {
// Get configuration for a single key
Mono<ConfigurationItem> item = client.getConfiguration(CONFIG_STORE_NAME, CONFIG_KEY).block();
// Get configurations for multiple keys
Mono<Map<String, ConfigurationItem>> items =
client.getConfiguration(CONFIG_STORE_NAME, CONFIG_KEY_1, CONFIG_KEY_2);
// Subscribe to configuration changes
Flux<SubscribeConfigurationResponse> outFlux = client.subscribeConfiguration(CONFIG_STORE_NAME, CONFIG_KEY_1, CONFIG_KEY_2);
outFlux.subscribe(configItems -> configItems.forEach(...));
// Unsubscribe from configuration changes
Mono<UnsubscribeConfigurationResponse> unsubscribe = client.unsubscribeConfiguration(SUBSCRIPTION_ID, CONFIG_STORE_NAME)
}
```
- For a full list of configuration operations visit [How-To: Manage configuration from a store]({{< ref howto-manage-configuration.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/configuration) for code samples and instructions to try out different configuration operations.
### Query saved state
> Note this is a preview API and thus will only be accessible via the DaprPreviewClient interface and not the normal DaprClient interface
```java
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.DaprPreviewClient;
import io.dapr.client.domain.QueryStateItem;
import io.dapr.client.domain.QueryStateRequest;
import io.dapr.client.domain.QueryStateResponse;
import io.dapr.client.domain.query.Query;
import io.dapr.client.domain.query.Sorting;
import io.dapr.client.domain.query.filters.EqFilter;
try (DaprClient client = builder.build(); DaprPreviewClient previewClient = builder.buildPreviewClient()) {
String searchVal = args.length == 0 ? "searchValue" : args[0];
// Create JSON data
Listing first = new Listing();
first.setPropertyType("apartment");
first.setId("1000");
...
Listing second = new Listing();
second.setPropertyType("row-house");
second.setId("1002");
...
Listing third = new Listing();
third.setPropertyType("apartment");
third.setId("1003");
...
Listing fourth = new Listing();
fourth.setPropertyType("apartment");
fourth.setId("1001");
...
Map<String, String> meta = new HashMap<>();
meta.put("contentType", "application/json");
// Save state
SaveStateRequest request = new SaveStateRequest(STATE_STORE_NAME).setStates(
new State<>("1", first, null, meta, null),
new State<>("2", second, null, meta, null),
new State<>("3", third, null, meta, null),
new State<>("4", fourth, null, meta, null)
);
client.saveBulkState(request).block();
// Create query and query state request
Query query = new Query()
.setFilter(new EqFilter<>("propertyType", "apartment"))
.setSort(Arrays.asList(new Sorting("id", Sorting.Order.DESC)));
QueryStateRequest request = new QueryStateRequest(STATE_STORE_NAME)
.setQuery(query);
// Use preview client to call query state API
QueryStateResponse<MyData> result = previewClient.queryState(request, MyData.class).block();
// View Query state response
System.out.println("Found " + result.getResults().size() + " items.");
for (QueryStateItem<Listing> item : result.getResults()) {
System.out.println("Key: " + item.getKey());
System.out.println("Data: " + item.getValue());
}
}
```
- For a full how-to on query state, visit [How-To: Query state]({{< ref howto-state-query-api.md >}}).
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/querystate) for complete code sample.
### Distributed lock
```java
package io.dapr.examples.lock.grpc;
import io.dapr.client.DaprClientBuilder;
import io.dapr.client.DaprPreviewClient;
import io.dapr.client.domain.LockRequest;
import io.dapr.client.domain.UnlockRequest;
import io.dapr.client.domain.UnlockResponseStatus;
import reactor.core.publisher.Mono;
public class DistributedLockGrpcClient {
private static final String LOCK_STORE_NAME = "lockstore";
/**
* Executes various methods to check the different apis.
*
* @param args arguments
* @throws Exception throws Exception
*/
public static void main(String[] args) throws Exception {
try (DaprPreviewClient client = (new DaprClientBuilder()).buildPreviewClient()) {
System.out.println("Using preview client...");
tryLock(client);
unlock(client);
}
}
/**
* Trying to get lock.
*
* @param client DaprPreviewClient object
*/
public static void tryLock(DaprPreviewClient client) {
System.out.println("*******trying to get a free distributed lock********");
try {
LockRequest lockRequest = new LockRequest(LOCK_STORE_NAME, "resouce1", "owner1", 5);
Mono<Boolean> result = client.tryLock(lockRequest);
System.out.println("Lock result -> " + (Boolean.TRUE.equals(result.block()) ? "SUCCESS" : "FAIL"));
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
/**
* Unlock a lock.
*
* @param client DaprPreviewClient object
*/
public static void unlock(DaprPreviewClient client) {
System.out.println("*******unlock a distributed lock********");
try {
UnlockRequest unlockRequest = new UnlockRequest(LOCK_STORE_NAME, "resouce1", "owner1");
Mono<UnlockResponseStatus> result = client.unlock(unlockRequest);
System.out.println("Unlock result ->" + result.block().name());
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
}
```
- For a full how-to on distributed lock, visit [How-To: Use a Lock]({{< ref howto-use-distributed-lock.md >}})
- Visit [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/lock) for complete code sample.
### Workflow
```java
package io.dapr.examples.workflows;
import io.dapr.workflows.client.DaprWorkflowClient;
import io.dapr.workflows.client.WorkflowInstanceStatus;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* For setup instructions, see the README.
*/
public class DemoWorkflowClient {
/**
* The main method.
*
* @param args Input arguments (unused).
* @throws InterruptedException If program has been interrupted.
*/
public static void main(String[] args) throws InterruptedException {
DaprWorkflowClient client = new DaprWorkflowClient();
try (client) {
String separatorStr = "*******";
System.out.println(separatorStr);
String instanceId = client.scheduleNewWorkflow(DemoWorkflow.class, "input data");
System.out.printf("Started new workflow instance with random ID: %s%n", instanceId);
System.out.println(separatorStr);
System.out.println("**GetInstanceMetadata:Running Workflow**");
WorkflowInstanceStatus workflowMetadata = client.getInstanceState(instanceId, true);
System.out.printf("Result: %s%n", workflowMetadata);
System.out.println(separatorStr);
System.out.println("**WaitForInstanceStart**");
try {
WorkflowInstanceStatus waitForInstanceStartResult =
client.waitForInstanceStart(instanceId, Duration.ofSeconds(60), true);
System.out.printf("Result: %s%n", waitForInstanceStartResult);
} catch (TimeoutException ex) {
System.out.printf("waitForInstanceStart has an exception:%s%n", ex);
}
System.out.println(separatorStr);
System.out.println("**SendExternalMessage**");
client.raiseEvent(instanceId, "TestEvent", "TestEventPayload");
System.out.println(separatorStr);
System.out.println("** Registering parallel Events to be captured by allOf(t1,t2,t3) **");
client.raiseEvent(instanceId, "event1", "TestEvent 1 Payload");
client.raiseEvent(instanceId, "event2", "TestEvent 2 Payload");
client.raiseEvent(instanceId, "event3", "TestEvent 3 Payload");
System.out.printf("Events raised for workflow with instanceId: %s\n", instanceId);
System.out.println(separatorStr);
System.out.println("** Registering Event to be captured by anyOf(t1,t2,t3) **");
client.raiseEvent(instanceId, "e2", "event 2 Payload");
System.out.printf("Event raised for workflow with instanceId: %s\n", instanceId);
System.out.println(separatorStr);
System.out.println("**WaitForInstanceCompletion**");
try {
WorkflowInstanceStatus waitForInstanceCompletionResult =
client.waitForInstanceCompletion(instanceId, Duration.ofSeconds(60), true);
System.out.printf("Result: %s%n", waitForInstanceCompletionResult);
} catch (TimeoutException ex) {
System.out.printf("waitForInstanceCompletion has an exception:%s%n", ex);
}
System.out.println(separatorStr);
System.out.println("**purgeInstance**");
boolean purgeResult = client.purgeInstance(instanceId);
System.out.printf("purgeResult: %s%n", purgeResult);
System.out.println(separatorStr);
System.out.println("**raiseEvent**");
String eventInstanceId = client.scheduleNewWorkflow(DemoWorkflow.class);
System.out.printf("Started new workflow instance with random ID: %s%n", eventInstanceId);
client.raiseEvent(eventInstanceId, "TestException", null);
System.out.printf("Event raised for workflow with instanceId: %s\n", eventInstanceId);
System.out.println(separatorStr);
String instanceToTerminateId = "terminateMe";
client.scheduleNewWorkflow(DemoWorkflow.class, null, instanceToTerminateId);
System.out.printf("Started new workflow instance with specified ID: %s%n", instanceToTerminateId);
TimeUnit.SECONDS.sleep(5);
System.out.println("Terminate this workflow instance manually before the timeout is reached");
client.terminateWorkflow(instanceToTerminateId, null);
System.out.println(separatorStr);
String restartingInstanceId = "restarting";
client.scheduleNewWorkflow(DemoWorkflow.class, null, restartingInstanceId);
System.out.printf("Started new workflow instance with ID: %s%n", restartingInstanceId);
System.out.println("Sleeping 30 seconds to restart the workflow");
TimeUnit.SECONDS.sleep(30);
System.out.println("**SendExternalMessage: RestartEvent**");
client.raiseEvent(restartingInstanceId, "RestartEvent", "RestartEventPayload");
System.out.println("Sleeping 30 seconds to terminate the eternal workflow");
TimeUnit.SECONDS.sleep(30);
client.terminateWorkflow(restartingInstanceId, null);
}
System.out.println("Exiting DemoWorkflowClient.");
System.exit(0);
}
}
```
- For a full guide on workflows, visit:
- [How-To: Author workflows]({{< ref howto-author-workflow.md >}}).
- [How-To: Manage workflows]({{< ref howto-manage-workflow.md >}}).
- [Learn more about how to use workflows with the Java SDK]({{< ref java-workflow.md >}}).
## Sidecar APIs
#### Wait for sidecar
The `DaprClient` also provides a helper method to wait for the sidecar to become healthy (components only). When using
this method, be sure to specify a timeout in milliseconds and block() to wait for the result of a reactive operation.
```java
// Wait for the Dapr sidecar to report healthy before attempting to use Dapr components.
try (DaprClient client = new DaprClientBuilder().build()) {
System.out.println("Waiting for Dapr sidecar ...");
client.waitForSidecar(10000).block(); // Specify the timeout in milliseconds
System.out.println("Dapr sidecar is ready.");
...
}
// Perform Dapr component operations here i.e. fetching secrets or saving state.
```
### Shutdown the sidecar
```java
try (DaprClient client = new DaprClientBuilder().build()) {
logger.info("Sending shutdown request.");
client.shutdown().block();
logger.info("Ensuring dapr has stopped.");
...
}
```
Learn more about the [Dapr Java SDK packages available to add to your Java applications](https://dapr.github.io/java-sdk/).
## Related links
- [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples)
For a full list of SDK properties and how to configure them, visit [Properties]({{< ref properties.md >}}).

View File

@ -0,0 +1,198 @@
---
type: docs
title: "Properties"
linkTitle: "Properties"
weight: 3001
description: SDK-wide properties for configuring the Dapr Java SDK using environment variables and system properties
---
# Properties
The Dapr Java SDK provides a set of global properties that control the behavior of the SDK. These properties can be configured using environment variables or system properties. System properties can be set using the `-D` flag when running your Java application.
These properties affect the entire SDK, including clients and runtime. They control aspects such as:
- Sidecar connectivity (endpoints, ports)
- Security settings (TLS, API tokens)
- Performance tuning (timeouts, connection pools)
- Protocol settings (gRPC, HTTP)
- String encoding
## Environment Variables
The following environment variables are available for configuring the Dapr Java SDK:
### Sidecar Endpoints
When these variables are set, the client will automatically use them to connect to the Dapr sidecar.
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_GRPC_ENDPOINT` | The gRPC endpoint for the Dapr sidecar | `localhost:50001` |
| `DAPR_HTTP_ENDPOINT` | The HTTP endpoint for the Dapr sidecar | `localhost:3500` |
| `DAPR_GRPC_PORT` | The gRPC port for the Dapr sidecar (legacy, `DAPR_GRPC_ENDPOINT` takes precedence) | `50001` |
| `DAPR_HTTP_PORT` | The HTTP port for the Dapr sidecar (legacy, `DAPR_HTTP_ENDPOINT` takes precedence) | `3500` |
### API Token
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_API_TOKEN` | API token for authentication between app and Dapr sidecar. This is the same token used by the Dapr runtime for API authentication. For more details, see [Dapr API token authentication](https://docs.dapr.io/operations/security/api-token/) and [Environment variables reference](https://docs.dapr.io/reference/environment/#dapr_api_token). | `null` |
### gRPC Configuration
#### TLS Settings
For secure gRPC communication, you can configure TLS settings using the following environment variables:
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_GRPC_TLS_INSECURE` | When set to "true", enables insecure TLS mode which still uses TLS but doesn't verify certificates. This uses InsecureTrustManagerFactory to trust all certificates. This should only be used for testing or in secure environments. | `false` |
| `DAPR_GRPC_TLS_CA_PATH` | Path to the CA certificate file. This is used for TLS connections to servers with self-signed certificates. | `null` |
| `DAPR_GRPC_TLS_CERT_PATH` | Path to the TLS certificate file for client authentication. | `null` |
| `DAPR_GRPC_TLS_KEY_PATH` | Path to the TLS private key file for client authentication. | `null` |
#### Keepalive Settings
Configure gRPC keepalive behavior using these environment variables:
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_GRPC_ENABLE_KEEP_ALIVE` | Whether to enable gRPC keepalive | `false` |
| `DAPR_GRPC_KEEP_ALIVE_TIME_SECONDS` | gRPC keepalive time in seconds | `10` |
| `DAPR_GRPC_KEEP_ALIVE_TIMEOUT_SECONDS` | gRPC keepalive timeout in seconds | `5` |
| `DAPR_GRPC_KEEP_ALIVE_WITHOUT_CALLS` | Whether to keep gRPC connection alive without calls | `true` |
### HTTP Client Configuration
These properties control the behavior of the HTTP client used for communication with the Dapr sidecar:
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_HTTP_CLIENT_READ_TIMEOUT_SECONDS` | Timeout in seconds for HTTP client read operations. This is the maximum time to wait for a response from the Dapr sidecar. | `60` |
| `DAPR_HTTP_CLIENT_MAX_REQUESTS` | Maximum number of concurrent HTTP requests that can be executed. Above this limit, requests will queue in memory waiting for running calls to complete. | `1024` |
| `DAPR_HTTP_CLIENT_MAX_IDLE_CONNECTIONS` | Maximum number of idle connections in the HTTP connection pool. This is the maximum number of connections that can remain idle in the pool. | `128` |
### API Configuration
These properties control the behavior of API calls made through the SDK:
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_API_MAX_RETRIES` | Maximum number of retries for retriable exceptions when making API calls to the Dapr sidecar | `0` |
| `DAPR_API_TIMEOUT_MILLISECONDS` | Timeout in milliseconds for API calls to the Dapr sidecar. A value of 0 means no timeout. | `0` |
### String Encoding
| Environment Variable | Description | Default |
|---------------------|-------------|---------|
| `DAPR_STRING_CHARSET` | Character set used for string encoding/decoding in the SDK. Must be a valid Java charset name. | `UTF-8` |
### System Properties
All environment variables can be set as system properties using the `-D` flag. Here is the complete list of available system properties:
| System Property | Description | Default |
|----------------|-------------|---------|
| `dapr.sidecar.ip` | IP address for the Dapr sidecar | `localhost` |
| `dapr.http.port` | HTTP port for the Dapr sidecar | `3500` |
| `dapr.grpc.port` | gRPC port for the Dapr sidecar | `50001` |
| `dapr.grpc.tls.cert.path` | Path to the gRPC TLS certificate | `null` |
| `dapr.grpc.tls.key.path` | Path to the gRPC TLS key | `null` |
| `dapr.grpc.tls.ca.path` | Path to the gRPC TLS CA certificate | `null` |
| `dapr.grpc.tls.insecure` | Whether to use insecure TLS mode | `false` |
| `dapr.grpc.endpoint` | gRPC endpoint for remote sidecar | `null` |
| `dapr.grpc.enable.keep.alive` | Whether to enable gRPC keepalive | `false` |
| `dapr.grpc.keep.alive.time.seconds` | gRPC keepalive time in seconds | `10` |
| `dapr.grpc.keep.alive.timeout.seconds` | gRPC keepalive timeout in seconds | `5` |
| `dapr.grpc.keep.alive.without.calls` | Whether to keep gRPC connection alive without calls | `true` |
| `dapr.http.endpoint` | HTTP endpoint for remote sidecar | `null` |
| `dapr.api.maxRetries` | Maximum number of retries for API calls | `0` |
| `dapr.api.timeoutMilliseconds` | Timeout for API calls in milliseconds | `0` |
| `dapr.api.token` | API token for authentication | `null` |
| `dapr.string.charset` | String encoding used in the SDK | `UTF-8` |
| `dapr.http.client.readTimeoutSeconds` | Timeout in seconds for HTTP client reads | `60` |
| `dapr.http.client.maxRequests` | Maximum number of concurrent HTTP requests | `1024` |
| `dapr.http.client.maxIdleConnections` | Maximum number of idle HTTP connections | `128` |
## Property Resolution Order
Properties are resolved in the following order:
1. Override values (if provided when creating a Properties instance)
2. System properties (set via `-D`)
3. Environment variables
4. Default values
The SDK checks each source in order. If a value is invalid for the property type (e.g., non-numeric for a numeric property), the SDK will log a warning and try the next source. For example:
```bash
# Invalid boolean value - will be ignored
java -Ddapr.grpc.enable.keep.alive=not-a-boolean -jar myapp.jar
# Valid boolean value - will be used
export DAPR_GRPC_ENABLE_KEEP_ALIVE=false
```
In this case, the environment variable is used because the system property value is invalid. However, if both values are valid, the system property takes precedence:
```bash
# Valid boolean value - will be used
java -Ddapr.grpc.enable.keep.alive=true -jar myapp.jar
# Valid boolean value - will be ignored
export DAPR_GRPC_ENABLE_KEEP_ALIVE=false
```
Override values can be set using the `DaprClientBuilder` in two ways:
1. Using individual property overrides (recommended for most cases):
```java
import io.dapr.config.Properties;
// Set a single property override
DaprClient client = new DaprClientBuilder()
.withPropertyOverride(Properties.GRPC_ENABLE_KEEP_ALIVE, "true")
.build();
// Or set multiple property overrides
DaprClient client = new DaprClientBuilder()
.withPropertyOverride(Properties.GRPC_ENABLE_KEEP_ALIVE, "true")
.withPropertyOverride(Properties.HTTP_CLIENT_READ_TIMEOUT_SECONDS, "120")
.build();
```
2. Using a Properties instance (useful when you have many properties to set at once):
```java
// Create a map of property overrides
Map<String, String> overrides = new HashMap<>();
overrides.put("dapr.grpc.enable.keep.alive", "true");
overrides.put("dapr.http.client.readTimeoutSeconds", "120");
// Create a Properties instance with overrides
Properties properties = new Properties(overrides);
// Use these properties when creating a client
DaprClient client = new DaprClientBuilder()
.withProperties(properties)
.build();
```
For most use cases, you'll use system properties or environment variables. Override values are primarily used when you need different property values for different instances of the SDK in the same application.
## Proxy Configuration
You can configure proxy settings for your Java application using system properties. These are standard Java system properties that are part of Java's networking layer (`java.net` package), not specific to Dapr. They are used by Java's networking stack, including the HTTP client that Dapr's SDK uses.
For detailed information about Java's proxy configuration, including all available properties and their usage, see the [Java Networking Properties documentation](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/doc-files/net-properties.html).
For example, here's how to configure a proxy:
```bash
# Configure HTTP proxy - replace with your actual proxy server details
java -Dhttp.proxyHost=your-proxy-server.com -Dhttp.proxyPort=8080 -jar myapp.jar
# Configure HTTPS proxy - replace with your actual proxy server details
java -Dhttps.proxyHost=your-proxy-server.com -Dhttps.proxyPort=8443 -jar myapp.jar
```
Replace `your-proxy-server.com` with your actual proxy server hostname or IP address, and adjust the port numbers to match your proxy server configuration.
These proxy settings will affect all HTTP/HTTPS connections made by your Java application, including connections to the Dapr sidecar.

View File

@ -0,0 +1,7 @@
---
type: docs
title: "Jobs"
linkTitle: "Jobs"
weight: 3000
description: With the Dapr Jobs package, you can interact with the Dapr Jobs APIs from a Java application to trigger future operations to run according to a predefined schedule with an optional payload. To get started, walk through the [Dapr Jobs]({{< ref java-jobs-howto.md >}}) how-to guide.
---

View File

@ -0,0 +1,164 @@
---
type: docs
title: "How to: Author and manage Dapr Jobs in the Java SDK"
linkTitle: "How to: Author and manage Jobs"
weight: 20000
description: How to get up and running with Jobs using the Dapr Java SDK
---
As part of this demonstration we will schedule a Dapr Job. The scheduled job will trigger an endpoint registered in the
same app. With the [provided jobs example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/jobs), you will:
- Schedule a Job [Job scheduling example](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/jobs/DemoJobsClient.java)
- Register an endpoint for the dapr sidecar to invoke at trigger time [Endpoint Registration](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/jobs/DemoJobsSpringApplication.java)
This example uses the default configuration from `dapr init` in [self-hosted mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted).
## Prerequisites
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started).
- Java JDK 11 (or greater):
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads), or
- OpenJDK
- [Apache Maven](https://maven.apache.org/install.html), version 3.x.
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
## Set up the environment
Clone the [Java SDK repo](https://github.com/dapr/java-sdk) and navigate into it.
```bash
git clone https://github.com/dapr/java-sdk.git
cd java-sdk
```
Run the following command to install the requirements for running the jobs example with the Dapr Java SDK.
```bash
mvn clean install -DskipTests
```
From the Java SDK root directory, navigate to the examples' directory.
```bash
cd examples
```
Run the Dapr sidecar.
```sh
dapr run --app-id jobsapp --dapr-grpc-port 51439 --dapr-http-port 3500 --app-port 8080
```
> Now, Dapr is listening for HTTP requests at `http://localhost:3500` and internal Jobs gRPC requests at `http://localhost:51439`.
## Schedule and Get a job
In the `DemoJobsClient` there are steps to schedule a job. Calling `scheduleJob` using the `DaprPreviewClient`
will schedule a job with the Dapr Runtime.
```java
public class DemoJobsClient {
/**
* The main method of this app to schedule and get jobs.
*/
public static void main(String[] args) throws Exception {
try (DaprPreviewClient client = new DaprClientBuilder().withPropertyOverrides(overrides).buildPreviewClient()) {
// Schedule a job.
System.out.println("**** Scheduling a Job with name dapr-jobs-1 *****");
ScheduleJobRequest scheduleJobRequest = new ScheduleJobRequest("dapr-job-1",
JobSchedule.fromString("* * * * * *")).setData("Hello World!".getBytes());
client.scheduleJob(scheduleJobRequest).block();
System.out.println("**** Scheduling job dapr-jobs-1 completed *****");
}
}
}
```
Call `getJob` to retrieve the job details that were previously created and scheduled.
```
client.getJob(new GetJobRequest("dapr-job-1")).block()
```
Run the `DemoJobsClient` with the following command.
```sh
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.jobs.DemoJobsClient
```
### Sample output
```
**** Scheduling a Job with name dapr-jobs-1 *****
**** Scheduling job dapr-jobs-1 completed *****
**** Retrieving a Job with name dapr-jobs-1 *****
```
## Set up an endpoint to be invoked when the job is triggered
The `DemoJobsSpringApplication` class starts a Spring Boot application that registers the endpoints specified in the `JobsController`
This endpoint acts like a callback for the scheduled job requests.
```java
@RestController
public class JobsController {
/**
* Handles jobs callback from Dapr.
*
* @param jobName name of the job.
* @param payload data from the job if payload exists.
* @return Empty Mono.
*/
@PostMapping("/job/{jobName}")
public Mono<Void> handleJob(@PathVariable("jobName") String jobName,
@RequestBody(required = false) byte[] payload) {
System.out.println("Job Name: " + jobName);
System.out.println("Job Payload: " + new String(payload));
return Mono.empty();
}
}
```
Parameters:
* `jobName`: The name of the triggered job.
* `payload`: Optional payload data associated with the job (as a byte array).
Run the Spring Boot application with the following command.
```sh
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.jobs.DemoJobsSpringApplication
```
### Sample output
```
Job Name: dapr-job-1
Job Payload: Hello World!
```
## Delete a scheduled job
```java
public class DemoJobsClient {
/**
* The main method of this app deletes a job that was previously scheduled.
*/
public static void main(String[] args) throws Exception {
try (DaprPreviewClient client = new DaprClientBuilder().buildPreviewClient()) {
// Delete a job.
System.out.println("**** Delete a Job with name dapr-jobs-1 *****");
client.deleteJob(new DeleteJobRequest("dapr-job-1")).block();
}
}
}
```
## Next steps
- [Learn more about Jobs]({{< ref jobs-overview.md >}})
- [Jobs API reference]({{< ref jobs_api.md >}})

View File

@ -0,0 +1,7 @@
---
type: docs
title: "Workflow"
linkTitle: "Workflow"
weight: 3000
description: How to get up and running with the Dapr Workflow extension
---

View File

@ -0,0 +1,249 @@
---
type: docs
title: "How to: Author and manage Dapr Workflow in the Java SDK"
linkTitle: "How to: Author and manage workflows"
weight: 20000
description: How to get up and running with workflows using the Dapr Java SDK
---
Lets create a Dapr workflow and invoke it using the console. With the [provided workflow example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows), you will:
- Execute the workflow instance using the [Java workflow worker](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/DemoWorkflowWorker.java)
- Utilize the Java workflow client and API calls to [start and terminate workflow instances](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/DemoWorkflowClient.java)
This example uses the default configuration from `dapr init` in [self-hosted mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted).
## Prerequisites
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started).
- Java JDK 11 (or greater):
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads), or
- OpenJDK
- [Apache Maven](https://maven.apache.org/install.html), version 3.x.
<!-- IGNORE_LINKS -->
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
<!-- END_IGNORE -->
- Verify you're using the latest proto bindings
## Set up the environment
Clone the Java SDK repo and navigate into it.
```bash
git clone https://github.com/dapr/java-sdk.git
cd java-sdk
```
Run the following command to install the requirements for running this workflow sample with the Dapr Java SDK.
```bash
mvn clean install
```
From the Java SDK root directory, navigate to the Dapr Workflow example.
```bash
cd examples
```
## Run the `DemoWorkflowWorker`
The `DemoWorkflowWorker` class registers an implementation of `DemoWorkflow` in Dapr's workflow runtime engine. In the `DemoWorkflowWorker.java` file, you can find the `DemoWorkflowWorker` class and the `main` method:
```java
public class DemoWorkflowWorker {
public static void main(String[] args) throws Exception {
// Register the Workflow with the runtime.
WorkflowRuntime.getInstance().registerWorkflow(DemoWorkflow.class);
System.out.println("Start workflow runtime");
WorkflowRuntime.getInstance().startAndBlock();
System.exit(0);
}
}
```
In the code above:
- `WorkflowRuntime.getInstance().registerWorkflow()` registers `DemoWorkflow` as a workflow in the Dapr Workflow runtime.
- `WorkflowRuntime.getInstance().start()` builds and starts the engine within the Dapr Workflow runtime.
In the terminal, execute the following command to kick off the `DemoWorkflowWorker`:
```sh
dapr run --app-id demoworkflowworker --resources-path ./components/workflows --dapr-grpc-port 50001 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.DemoWorkflowWorker
```
**Expected output**
```
You're up and running! Both Dapr and your app logs will appear here.
...
== APP == Start workflow runtime
== APP == Sep 13, 2023 9:02:03 AM com.microsoft.durabletask.DurableTaskGrpcWorker startAndBlock
== APP == INFO: Durable Task worker is connecting to sidecar at 127.0.0.1:50001.
```
## Run the `DemoWorkflowClient
The `DemoWorkflowClient` starts instances of workflows that have been registered with Dapr.
```java
public class DemoWorkflowClient {
// ...
public static void main(String[] args) throws InterruptedException {
DaprWorkflowClient client = new DaprWorkflowClient();
try (client) {
String separatorStr = "*******";
System.out.println(separatorStr);
String instanceId = client.scheduleNewWorkflow(DemoWorkflow.class, "input data");
System.out.printf("Started new workflow instance with random ID: %s%n", instanceId);
System.out.println(separatorStr);
System.out.println("**GetInstanceMetadata:Running Workflow**");
WorkflowInstanceStatus workflowMetadata = client.getInstanceState(instanceId, true);
System.out.printf("Result: %s%n", workflowMetadata);
System.out.println(separatorStr);
System.out.println("**WaitForInstanceStart**");
try {
WorkflowInstanceStatus waitForInstanceStartResult =
client.waitForInstanceStart(instanceId, Duration.ofSeconds(60), true);
System.out.printf("Result: %s%n", waitForInstanceStartResult);
} catch (TimeoutException ex) {
System.out.printf("waitForInstanceStart has an exception:%s%n", ex);
}
System.out.println(separatorStr);
System.out.println("**SendExternalMessage**");
client.raiseEvent(instanceId, "TestEvent", "TestEventPayload");
System.out.println(separatorStr);
System.out.println("** Registering parallel Events to be captured by allOf(t1,t2,t3) **");
client.raiseEvent(instanceId, "event1", "TestEvent 1 Payload");
client.raiseEvent(instanceId, "event2", "TestEvent 2 Payload");
client.raiseEvent(instanceId, "event3", "TestEvent 3 Payload");
System.out.printf("Events raised for workflow with instanceId: %s\n", instanceId);
System.out.println(separatorStr);
System.out.println("** Registering Event to be captured by anyOf(t1,t2,t3) **");
client.raiseEvent(instanceId, "e2", "event 2 Payload");
System.out.printf("Event raised for workflow with instanceId: %s\n", instanceId);
System.out.println(separatorStr);
System.out.println("**WaitForInstanceCompletion**");
try {
WorkflowInstanceStatus waitForInstanceCompletionResult =
client.waitForInstanceCompletion(instanceId, Duration.ofSeconds(60), true);
System.out.printf("Result: %s%n", waitForInstanceCompletionResult);
} catch (TimeoutException ex) {
System.out.printf("waitForInstanceCompletion has an exception:%s%n", ex);
}
System.out.println(separatorStr);
System.out.println("**purgeInstance**");
boolean purgeResult = client.purgeInstance(instanceId);
System.out.printf("purgeResult: %s%n", purgeResult);
System.out.println(separatorStr);
System.out.println("**raiseEvent**");
String eventInstanceId = client.scheduleNewWorkflow(DemoWorkflow.class);
System.out.printf("Started new workflow instance with random ID: %s%n", eventInstanceId);
client.raiseEvent(eventInstanceId, "TestException", null);
System.out.printf("Event raised for workflow with instanceId: %s\n", eventInstanceId);
System.out.println(separatorStr);
String instanceToTerminateId = "terminateMe";
client.scheduleNewWorkflow(DemoWorkflow.class, null, instanceToTerminateId);
System.out.printf("Started new workflow instance with specified ID: %s%n", instanceToTerminateId);
TimeUnit.SECONDS.sleep(5);
System.out.println("Terminate this workflow instance manually before the timeout is reached");
client.terminateWorkflow(instanceToTerminateId, null);
System.out.println(separatorStr);
String restartingInstanceId = "restarting";
client.scheduleNewWorkflow(DemoWorkflow.class, null, restartingInstanceId);
System.out.printf("Started new workflow instance with ID: %s%n", restartingInstanceId);
System.out.println("Sleeping 30 seconds to restart the workflow");
TimeUnit.SECONDS.sleep(30);
System.out.println("**SendExternalMessage: RestartEvent**");
client.raiseEvent(restartingInstanceId, "RestartEvent", "RestartEventPayload");
System.out.println("Sleeping 30 seconds to terminate the eternal workflow");
TimeUnit.SECONDS.sleep(30);
client.terminateWorkflow(restartingInstanceId, null);
}
System.out.println("Exiting DemoWorkflowClient.");
System.exit(0);
}
}
```
In a second terminal window, start the workflow by running the following command:
```sh
java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.workflows.DemoWorkflowClient
```
**Expected output**
```
*******
Started new workflow instance with random ID: 0b4cc0d5-413a-4c1c-816a-a71fa24740d4
*******
**GetInstanceMetadata:Running Workflow**
Result: [Name: 'io.dapr.examples.workflows.DemoWorkflow', ID: '0b4cc0d5-413a-4c1c-816a-a71fa24740d4', RuntimeStatus: RUNNING, CreatedAt: 2023-09-13T13:02:30.547Z, LastUpdatedAt: 2023-09-13T13:02:30.699Z, Input: '"input data"', Output: '']
*******
**WaitForInstanceStart**
Result: [Name: 'io.dapr.examples.workflows.DemoWorkflow', ID: '0b4cc0d5-413a-4c1c-816a-a71fa24740d4', RuntimeStatus: RUNNING, CreatedAt: 2023-09-13T13:02:30.547Z, LastUpdatedAt: 2023-09-13T13:02:30.699Z, Input: '"input data"', Output: '']
*******
**SendExternalMessage**
*******
** Registering parallel Events to be captured by allOf(t1,t2,t3) **
Events raised for workflow with instanceId: 0b4cc0d5-413a-4c1c-816a-a71fa24740d4
*******
** Registering Event to be captured by anyOf(t1,t2,t3) **
Event raised for workflow with instanceId: 0b4cc0d5-413a-4c1c-816a-a71fa24740d4
*******
**WaitForInstanceCompletion**
Result: [Name: 'io.dapr.examples.workflows.DemoWorkflow', ID: '0b4cc0d5-413a-4c1c-816a-a71fa24740d4', RuntimeStatus: FAILED, CreatedAt: 2023-09-13T13:02:30.547Z, LastUpdatedAt: 2023-09-13T13:02:55.054Z, Input: '"input data"', Output: '']
*******
**purgeInstance**
purgeResult: true
*******
**raiseEvent**
Started new workflow instance with random ID: 7707d141-ebd0-4e54-816e-703cb7a52747
Event raised for workflow with instanceId: 7707d141-ebd0-4e54-816e-703cb7a52747
*******
Started new workflow instance with specified ID: terminateMe
Terminate this workflow instance manually before the timeout is reached
*******
Started new workflow instance with ID: restarting
Sleeping 30 seconds to restart the workflow
**SendExternalMessage: RestartEvent**
Sleeping 30 seconds to terminate the eternal workflow
Exiting DemoWorkflowClient.
```
## What happened?
1. When you ran `dapr run`, the workflow worker registered the workflow (`DemoWorkflow`) and its actvities to the Dapr Workflow engine.
1. When you ran `java`, the workflow client started the workflow instance with the following activities. You can follow along with the output in the terminal where you ran `dapr run`.
1. The workflow is started, raises three parallel tasks, and waits for them to complete.
1. The workflow client calls the activity and sends the "Hello Activity" message to the console.
1. The workflow times out and is purged.
1. The workflow client starts a new workflow instance with a random ID, uses another workflow instance called `terminateMe` to terminate it, and restarts it with the workflow called `restarting`.
1. The worfklow client is then exited.
## Next steps
- [Learn more about Dapr workflow]({{< ref workflow-overview.md >}})
- [Workflow API reference]({{< ref workflow_api.md >}})

View File

@ -0,0 +1,335 @@
---
type: docs
title: "Getting started with the Dapr and Spring Boot"
linkTitle: "Spring Boot Integration"
weight: 4000
description: How to get started with Dapr and Spring Boot
---
By combining Dapr and Spring Boot, we can create infrastructure independent Java applications that can be deployed across different environments, supporting a wide range of on-premises and cloud provider services.
First, we will start with a simple integration covering the `DaprClient` and the [Testcontainers](https://testcontainers.com/) integration, to then use Spring and Spring Boot mechanisms and programming model to leverage the Dapr APIs under the hood. This helps teams to remove dependencies such as clients and drivers required to connect to environment-specific infrastructure (databases, key-value stores, message brokers, configuration/secret stores, etc)
{{% alert title="Note" color="primary" %}}
The Spring Boot integration requires Spring Boot 3.x+ to work. This will not work with Spring Boot 2.x.
The Spring Boot integration remains in alpha. We need your help and feedback to graduate it.
Please join the [#java-sdk discord channel](https://discord.com/channels/778680217417809931/778749797242765342) discussion or open issues in the [dapr/java-sdk](https://github.com/dapr/java-sdk/issues).
{{% /alert %}}
## Adding the Dapr and Spring Boot integration to your project
If you already have a Spring Boot application, you can directly add the following dependencies to your project:
```
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-starter</artifactId>
<version>0.x.x</version> // see below for the latest versions
</dependency>
<dependency>
<groupId>io.dapr.spring</groupId>
<artifactId>dapr-spring-boot-starter-test</artifactId>
<version>0.x.x</version> // see below for the latest versions
<scope>test</scope>
</dependency>
```
You can find the [latest released version here](https://central.sonatype.com/artifact/io.dapr.spring/dapr-spring-boot-starter).
By adding these dependencies, you can:
- Autowire a `DaprClient` to use inside your applications
- Use the Spring Data and Messaging abstractions and programming model that uses the Dapr APIs under the hood
- Improve your inner-development loop by relying on [Testcontainers](https://testcontainers.com/) to bootstrap Dapr Control plane services and default components
Once these dependencies are in your application, you can rely on Spring Boot autoconfiguration to autowire a `DaprClient` instance:
```java
@Autowired
private DaprClient daprClient;
```
This will connect to the default Dapr gRPC endpoint `localhost:50001`, requiring you to start Dapr outside of your application.
You can use the `DaprClient` to interact with the Dapr APIs anywhere in your application, for example from inside a REST endpoint:
```java
@RestController
public class DemoRestController {
@Autowired
private DaprClient daprClient;
@PostMapping("/store")
public void storeOrder(@RequestBody Order order){
daprClient.saveState("kvstore", order.orderId(), order).block();
}
}
record Order(String orderId, Integer amount){}
```
If you want to avoid managing Dapr outside of your Spring Boot application, you can rely on [Testcontainers](https://testcontainers.com/) to bootstrap Dapr beside your application for development purposes.
To do this we can create a test configuration that uses `Testcontainers` to bootstrap all we need to develop our applications using the Dapr APIs.
Using [Testcontainers](https://testcontainers.com/) and Dapr integrations, we let the `@TestConfiguration` bootstrap Dapr for our applications.
Notice that for this example, we are configuring Dapr with a Statestore component called `kvstore` that connects to an instance of `PostgreSQL` also bootstrapped by Testcontainers.
```java
@TestConfiguration(proxyBeanMethods = false)
public class DaprTestContainersConfig {
@Bean
@ServiceConnection
public DaprContainer daprContainer(Network daprNetwork, PostgreSQLContainer<?> postgreSQLContainer){
return new DaprContainer("daprio/daprd:1.15.4")
.withAppName("producer-app")
.withNetwork(daprNetwork)
.withComponent(new Component("kvstore", "state.postgresql", "v1", STATE_STORE_PROPERTIES))
.withComponent(new Component("kvbinding", "bindings.postgresql", "v1", BINDING_PROPERTIES))
.dependsOn(postgreSQLContainer);
}
}
```
Inside the test classpath you can add a new Spring Boot Application that uses this configuration for tests:
```java
@SpringBootApplication
public class TestProducerApplication {
public static void main(String[] args) {
SpringApplication
.from(ProducerApplication::main)
.with(DaprTestContainersConfig.class)
.run(args);
}
}
```
Now you can start your application with:
```bash
mvn spring-boot:test-run
```
Running this command will start the application, using the provided test configuration that includes the Testcontainers and Dapr integration. In the logs you should be able to see that the `daprd` and the `placement` service containers were started for your application.
Besides the previous configuration (`DaprTestContainersConfig`) your tests shouldn't be testing Dapr itself, just the REST endpoints that your application is exposing.
## Leveraging Spring & Spring Boot programming model with Dapr
The Java SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}).
But if you want to leverage the Spring and Spring Boot programming model you can use the `dapr-spring-boot-starter` integration.
This includes implementations of Spring Data (`KeyValueTemplate` and `CrudRepository`) as well as a `DaprMessagingTemplate` for producing and consuming messages
(similar to [Spring Kafka](https://spring.io/projects/spring-kafka), [Spring Pulsar](https://spring.io/projects/spring-pulsar) and [Spring AMQP for RabbitMQ](https://spring.io/projects/spring-amqp)) and Dapr workflows.
## Using Spring Data `CrudRepository` and `KeyValueTemplate`
You can use well known Spring Data constructs relying on a Dapr-based implementation.
With Dapr, you don't need to add any infrastructure-related driver or client, making your Spring application lighter and decoupled from the environment where it is running.
Under the hood these implementations use the Dapr Statestore and Binding APIs.
### Configuration parameters
With Spring Data abstractions you can configure which statestore and bindings will be used by Dapr to connect to the available infrastructure.
This can be done by setting the following properties:
```properties
dapr.statestore.name=kvstore
dapr.statestore.binding=kvbinding
```
Then you can `@Autowire` a `KeyValueTemplate` or a `CrudRepository` like this:
```java
@RestController
@EnableDaprRepositories
public class OrdersRestController {
@Autowired
private OrderRepository repository;
@PostMapping("/orders")
public void storeOrder(@RequestBody Order order){
repository.save(order);
}
@GetMapping("/orders")
public Iterable<Order> getAll(){
return repository.findAll();
}
}
```
Where `OrderRepository` is defined in an interface that extends the Spring Data `CrudRepository` interface:
```java
public interface OrderRepository extends CrudRepository<Order, String> {}
```
Notice that the `@EnableDaprRepositories` annotation does all the magic of wiring the Dapr APIs under the `CrudRespository` interface.
Because Dapr allow users to interact with different StateStores from the same application, as a user you need to provide the following beans as a Spring Boot `@Configuration`:
```java
@Configuration
@EnableConfigurationProperties({DaprStateStoreProperties.class})
public class ProducerAppConfiguration {
@Bean
public KeyValueAdapterResolver keyValueAdapterResolver(DaprClient daprClient, ObjectMapper mapper, DaprStateStoreProperties daprStatestoreProperties) {
String storeName = daprStatestoreProperties.getName();
String bindingName = daprStatestoreProperties.getBinding();
return new DaprKeyValueAdapterResolver(daprClient, mapper, storeName, bindingName);
}
@Bean
public DaprKeyValueTemplate daprKeyValueTemplate(KeyValueAdapterResolver keyValueAdapterResolver) {
return new DaprKeyValueTemplate(keyValueAdapterResolver);
}
}
```
## Using Spring Messaging for producing and consuming events
Similar to Spring Kafka, Spring Pulsar and Spring AMQP you can use the `DaprMessagingTemplate` to publish messages to the configured infrastructure. To consume messages you can use the `@Topic` annotation (soon to be renamed to `@DaprListener`).
To publish events/messages you can `@Autowired` the `DaprMessagingTemplate` in your Spring application.
For this example we will be publishing `Order` events and we are sending messages to the topic named `topic`.
```java
@Autowired
private DaprMessagingTemplate<Order> messagingTemplate;
@PostMapping("/orders")
public void storeOrder(@RequestBody Order order){
repository.save(order);
messagingTemplate.send("topic", order);
}
```
Similarly to the `CrudRepository` we need to specify which PubSub broker do we want to use to publish and consume our messages.
```properties
dapr.pubsub.name=pubsub
```
Because with Dapr you can connect to multiple PubSub brokers you need to provide the following bean to let Dapr know which PubSub broker your `DaprMessagingTemplate` will use:
```java
@Bean
public DaprMessagingTemplate<Order> messagingTemplate(DaprClient daprClient,
DaprPubSubProperties daprPubSubProperties) {
return new DaprMessagingTemplate<>(daprClient, daprPubSubProperties.getName());
}
```
Finally, because Dapr PubSub requires a bidirectional connection between your application and Dapr you need to expand your Testcontainers configuration with a few parameters:
```java
@Bean
@ServiceConnection
public DaprContainer daprContainer(Network daprNetwork, PostgreSQLContainer<?> postgreSQLContainer, RabbitMQContainer rabbitMQContainer){
return new DaprContainer("daprio/daprd:1.15.4")
.withAppName("producer-app")
.withNetwork(daprNetwork)
.withComponent(new Component("kvstore", "state.postgresql", "v1", STATE_STORE_PROPERTIES))
.withComponent(new Component("kvbinding", "bindings.postgresql", "v1", BINDING_PROPERTIES))
.withComponent(new Component("pubsub", "pubsub.rabbitmq", "v1", rabbitMqProperties))
.withAppPort(8080)
.withAppChannelAddress("host.testcontainers.internal")
.dependsOn(rabbitMQContainer)
.dependsOn(postgreSQLContainer);
}
```
Now, in the Dapr configuration we have included a `pubsub` component that will connect to an instance of RabbitMQ started by Testcontainers.
We have also set two important parameters `.withAppPort(8080)` and `.withAppChannelAddress("host.testcontainers.internal")` which allows Dapr to
contact back to the application when a message is published in the broker.
To listen to events/messages you need to expose an endpoint in the application that will be responsible to receive the messages.
If you expose a REST endpoint you can use the `@Topic` annotation to let Dapr know where it needs to forward the events/messages too:
```java
@PostMapping("subscribe")
@Topic(pubsubName = "pubsub", name = "topic")
public void subscribe(@RequestBody CloudEvent<Order> cloudEvent){
events.add(cloudEvent);
}
```
Upon bootstrapping your application, Dapr will register the subscription to messages to be forwarded to the `subscribe` endpoint exposed by your application.
If you are writing tests for these subscribers you need to ensure that Testcontainers knows that your application will be running on port 8080,
so containers started with Testcontainers know where your application is:
```java
@BeforeAll
public static void setup(){
org.testcontainers.Testcontainers.exposeHostPorts(8080);
}
```
You can check and run the [full example source code here](https://github.com/salaboy/dapr-spring-boot-docs-examples).
## Using Dapr Workflows with Spring Boot
Following the same approach that we used for Spring Data and Spring Messaging, the `dapr-spring-boot-starter` brings Dapr Workflow integration for Spring Boot users.
To work with Dapr Workflows you need to define and implement your workflows using code. The Dapr Spring Boot Starter makes your life easier by managing `Workflow`s and `WorkflowActivity`s as Spring beans.
In order to enable the automatic bean discovery you can annotate your `@SpringBootApplication` with the `@EnableDaprWorkflows` annotation:
```
@SpringBootApplication
@EnableDaprWorkflows
public class MySpringBootApplication {}
```
By adding this annotation, all the `WorkflowActivity`s will be automatically managed by Spring and registered to the workflow engine.
By having all `WorkflowActivity`s as managed beans we can use Spring `@Autowired` mechanism to inject any bean that our workflow activity might need to implement its functionality, for example the `@RestTemplate`:
```
public class MyWorkflowActivity implements WorkflowActivity {
@Autowired
private RestTemplate restTemplate;
```
You can also `@Autowired` the `DaprWorkflowClient` to create new instances of your workflows.
```
@Autowired
private DaprWorkflowClient daprWorkflowClient;
```
This enable applications to schedule new workflow instances and raise events.
```
String instanceId = daprWorkflowClient.scheduleNewWorkflow(MyWorkflow.class, payload);
```
and
```
daprWorkflowClient.raiseEvent(instanceId, "MyEvenet", event);
```
Check the [Dapr Workflow documentation](https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/) for more information about how to work with Dapr Workflows.
## Next steps
Learn more about the [Dapr Java SDK packages available to add to your Java applications](https://dapr.github.io/java-sdk/).
## Related links
- [Java SDK examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples)

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +1,33 @@
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (13.0.2) on Wed Oct 13 13:31:40 PDT 2021 -->
<title>All Packages (dapr-sdk-parent 1.3.1 API)</title>
<!-- Generated by javadoc (17) on Wed Apr 30 13:47:35 UTC 2025 -->
<title>All Packages (dapr-sdk-parent 1.14.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2021-10-13">
<meta name="dc.created" content="2025-04-30">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-packages-index">
<body class="all-packages-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
@ -44,122 +35,104 @@ loadScripts(document, 'script');</script>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
</div>
<div class="subNav">
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
</div>
<div class="allPackagesContainer">
<div class="packagesSummary">
<table>
<caption><span>Package Summary</span><span class="tabEnd">&nbsp;</span></caption>
<thead>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/package-summary.html">io.dapr</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/actors/package-summary.html">io.dapr.actors</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/actors/client/package-summary.html">io.dapr.actors.client</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/actors/runtime/package-summary.html">io.dapr.actors.runtime</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/client/package-summary.html">io.dapr.client</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/client/domain/package-summary.html">io.dapr.client.domain</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/config/package-summary.html">io.dapr.config</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/exceptions/package-summary.html">io.dapr.exceptions</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/internal/opencensus/package-summary.html">io.dapr.internal.opencensus</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/serializer/package-summary.html">io.dapr.serializer</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="io/dapr/utils/package-summary.html">io.dapr.utils</a></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<th class="colFirst" scope="row"><a href="io/dapr/v1/package-summary.html">io.dapr.v1</a></th>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="caption"><span>Package Summary</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="io/dapr/package-summary.html">io.dapr</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/actors/package-summary.html">io.dapr.actors</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/actors/client/package-summary.html">io.dapr.actors.client</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/actors/runtime/package-summary.html">io.dapr.actors.runtime</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/client/package-summary.html">io.dapr.client</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/client/domain/package-summary.html">io.dapr.client.domain</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/client/domain/query/package-summary.html">io.dapr.client.domain.query</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/client/domain/query/filters/package-summary.html">io.dapr.client.domain.query.filters</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/client/resiliency/package-summary.html">io.dapr.client.resiliency</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/config/package-summary.html">io.dapr.config</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/exceptions/package-summary.html">io.dapr.exceptions</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/internal/exceptions/package-summary.html">io.dapr.internal.exceptions</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/internal/grpc/package-summary.html">io.dapr.internal.grpc</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/internal/grpc/interceptors/package-summary.html">io.dapr.internal.grpc.interceptors</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/internal/opencensus/package-summary.html">io.dapr.internal.opencensus</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/internal/resiliency/package-summary.html">io.dapr.internal.resiliency</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/serializer/package-summary.html">io.dapr.serializer</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/spring/boot/autoconfigure/client/package-summary.html">io.dapr.spring.boot.autoconfigure.client</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/spring/boot/autoconfigure/pubsub/package-summary.html">io.dapr.spring.boot.autoconfigure.pubsub</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/spring/boot/autoconfigure/statestore/package-summary.html">io.dapr.spring.boot.autoconfigure.statestore</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/spring/boot/testcontainers/service/connection/package-summary.html">io.dapr.spring.boot.testcontainers.service.connection</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/spring/data/package-summary.html">io.dapr.spring.data</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/spring/data/repository/config/package-summary.html">io.dapr.spring.data.repository.config</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/spring/data/repository/query/package-summary.html">io.dapr.spring.data.repository.query</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/spring/messaging/package-summary.html">io.dapr.spring.messaging</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/spring/messaging/observation/package-summary.html">io.dapr.spring.messaging.observation</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/spring/workflows/config/package-summary.html">io.dapr.spring.workflows.config</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/testcontainers/package-summary.html">io.dapr.testcontainers</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/testcontainers/converter/package-summary.html">io.dapr.testcontainers.converter</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/utils/package-summary.html">io.dapr.utils</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/v1/package-summary.html">io.dapr.v1</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/workflows/package-summary.html">io.dapr.workflows</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/workflows/client/package-summary.html">io.dapr.workflows.client</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/workflows/internal/package-summary.html">io.dapr.workflows.internal</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/workflows/runtime/package-summary.html">io.dapr.workflows.runtime</a></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2021. All rights reserved.</small></p>
<hr>
<p class="legal-copy"><small>Copyright &#169; 2025. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,138 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Wed Apr 30 13:51:53 UTC 2025 -->
<title>All Classes and Interfaces (dapr-sdk-workflows 0.14.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2025-04-30">
<meta name="description" content="class index">
<meta name="generator" content="javadoc/AllClassesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-classes-index-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-classes">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All Classes and Interfaces" class="title">All Classes and Interfaces</h1>
</div>
<div id="all-classes-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="all-classes-table-tab0" role="tab" aria-selected="true" aria-controls="all-classes-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table', 2)" class="active-table-tab">All Classes and Interfaces</button><button id="all-classes-table-tab1" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab1', 2)" class="table-tab">Interfaces</button><button id="all-classes-table-tab2" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab2', 2)" class="table-tab">Classes</button><button id="all-classes-table-tab3" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab3', 2)" class="table-tab">Enums</button></div>
<div id="all-classes-table.tabpanel" role="tabpanel" aria-labelledby="all-classes-table-tab0">
<div class="summary-table two-column-summary">
<div class="table-header col-first">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/internal/ApiTokenClientInterceptor.html" title="class in io.dapr.workflows.internal">ApiTokenClientInterceptor</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/client/DaprWorkflowClient.html" title="class in io.dapr.workflows.client">DaprWorkflowClient</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">Defines client operations for managing Dapr Workflow instances.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/runtime/DefaultWorkflowContext.html" title="class in io.dapr.workflows.runtime">DefaultWorkflowContext</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/client/NewWorkflowOptions.html" title="class in io.dapr.workflows.client">NewWorkflowOptions</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">Options for starting a new instance of a workflow.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab1"><a href="io/dapr/workflows/Workflow.html" title="interface in io.dapr.workflows">Workflow</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab1">
<div class="block">Common interface for workflow implementations.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab1"><a href="io/dapr/workflows/WorkflowActivity.html" title="interface in io.dapr.workflows">WorkflowActivity</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab1">
<div class="block">Common interface for task activity implementations.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/runtime/WorkflowActivityClassWrapper.html" title="class in io.dapr.workflows.runtime">WorkflowActivityClassWrapper</a>&lt;<a href="io/dapr/workflows/runtime/WorkflowActivityClassWrapper.html" title="type parameter in WorkflowActivityClassWrapper">T</a> extends <a href="io/dapr/workflows/WorkflowActivity.html" title="interface in io.dapr.workflows">WorkflowActivity</a>&gt;</div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Wrapper for Durable Task Framework task activity factory.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab1"><a href="io/dapr/workflows/WorkflowActivityContext.html" title="interface in io.dapr.workflows">WorkflowActivityContext</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab1">&nbsp;</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/runtime/WorkflowActivityInstanceWrapper.html" title="class in io.dapr.workflows.runtime">WorkflowActivityInstanceWrapper</a>&lt;<a href="io/dapr/workflows/runtime/WorkflowActivityInstanceWrapper.html" title="type parameter in WorkflowActivityInstanceWrapper">T</a> extends <a href="io/dapr/workflows/WorkflowActivity.html" title="interface in io.dapr.workflows">WorkflowActivity</a>&gt;</div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Wrapper for Durable Task Framework task activity factory.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab1"><a href="io/dapr/workflows/WorkflowContext.html" title="interface in io.dapr.workflows">WorkflowContext</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab1">
<div class="block">Context object used by workflow implementations to perform actions such as scheduling activities,
durable timers, waiting for external events, and for getting basic information about the current
workflow instance.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/client/WorkflowFailureDetails.html" title="class in io.dapr.workflows.client">WorkflowFailureDetails</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Represents a workflow failure details.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/client/WorkflowInstanceStatus.html" title="class in io.dapr.workflows.client">WorkflowInstanceStatus</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
<div class="block">Represents a snapshot of a workflow instance's current state, including
metadata.</div>
</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/runtime/WorkflowRuntime.html" title="class in io.dapr.workflows.runtime">WorkflowRuntime</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Contains methods to register workflows and activities.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/runtime/WorkflowRuntimeBuilder.html" title="class in io.dapr.workflows.runtime">WorkflowRuntimeBuilder</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="io/dapr/workflows/runtime/WorkflowRuntimeStatus.html" title="enum in io.dapr.workflows.runtime">WorkflowRuntimeStatus</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab3">
<div class="block">Enum describing the runtime status of a workflow.</div>
</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab1"><a href="io/dapr/workflows/WorkflowStub.html" title="interface in io.dapr.workflows">WorkflowStub</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab1">&nbsp;</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/WorkflowTaskOptions.html" title="class in io.dapr.workflows">WorkflowTaskOptions</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/WorkflowTaskRetryPolicy.html" title="class in io.dapr.workflows">WorkflowTaskRetryPolicy</a></div>
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="io/dapr/workflows/WorkflowTaskRetryPolicy.Builder.html" title="class in io.dapr.workflows">WorkflowTaskRetryPolicy.Builder</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">&nbsp;</div>
</div>
</div>
</div>
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2025. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Wed Apr 30 13:51:53 UTC 2025 -->
<title>All Packages (dapr-sdk-workflows 0.14.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2025-04-30">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-packages-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
</div>
<div class="caption"><span>Package Summary</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="io/dapr/workflows/package-summary.html">io.dapr.workflows</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/workflows/client/package-summary.html">io.dapr.workflows.client</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><a href="io/dapr/workflows/internal/package-summary.html">io.dapr.workflows.internal</a></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><a href="io/dapr/workflows/runtime/package-summary.html">io.dapr.workflows.runtime</a></div>
<div class="col-last odd-row-color">&nbsp;</div>
</div>
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2025. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,168 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
body {
margin: 0px;
padding: 0px;
}
table {
padding:0px;
width: 100%;
margin-left: -2px;
margin-right: -2px;
}
acronym {
cursor: help;
border-bottom: 1px dotted #feb;
}
table.bodyTable th, table.bodyTable td {
padding: 2px 4px 2px 4px;
vertical-align: top;
}
div.clear{
clear:both;
visibility: hidden;
}
div.clear hr{
display: none;
}
#bannerLeft, #bannerRight {
font-size: xx-large;
font-weight: bold;
}
#bannerLeft img, #bannerRight img {
margin: 0px;
}
.xleft, #bannerLeft img {
float:left;
}
.xright, #bannerRight {
float:right;
}
#banner {
padding: 0px;
}
#breadcrumbs {
padding: 3px 10px 3px 10px;
}
#leftColumn {
width: 170px;
float:left;
overflow: auto;
}
#bodyColumn {
margin-right: 1.5em;
margin-left: 197px;
}
#legend {
padding: 8px 0 8px 0;
}
#navcolumn {
padding: 8px 4px 0 8px;
}
#navcolumn h5 {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn ul {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn li {
list-style-type: none;
background-image: none;
background-repeat: no-repeat;
background-position: 0 0.4em;
padding-left: 16px;
list-style-position: outside;
line-height: 1.2em;
font-size: smaller;
}
#navcolumn li.expanded {
background-image: url(../images/expanded.gif);
}
#navcolumn li.collapsed {
background-image: url(../images/collapsed.gif);
}
#navcolumn li.none {
text-indent: -1em;
margin-left: 1em;
}
#poweredBy {
text-align: center;
}
#navcolumn img {
margin-top: 10px;
margin-bottom: 3px;
}
#poweredBy img {
display:block;
margin: 20px 0 20px 17px;
}
#search img {
margin: 0px;
display: block;
}
#search #q, #search #btnG {
border: 1px solid #999;
margin-bottom:10px;
}
#search form {
margin: 0px;
}
#lastPublished {
font-size: x-small;
}
.navSection {
margin-bottom: 2px;
padding: 8px;
}
.navSectionHead {
font-weight: bold;
font-size: x-small;
}
.section {
padding: 4px;
}
#footer {
padding: 3px 10px 3px 10px;
font-size: x-small;
}
#breadcrumbs {
font-size: x-small;
margin: 0pt;
}
.source {
padding: 12px;
margin: 1em 7px 1em 7px;
}
.source pre {
margin: 0px;
padding: 0px;
}
#navcolumn img.imageLink, .imageLink {
padding-left: 0px;
padding-bottom: 0px;
padding-top: 0px;
padding-right: 2px;
border: 0px;
margin: 0px;
}

View File

@ -0,0 +1,161 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
body {
padding: 0px 0px 10px 0px;
}
body, td, select, input, li{
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 13px;
}
code{
font-family: Courier, monospace;
font-size: 13px;
}
a {
text-decoration: none;
}
a:link {
color:#36a;
}
a:visited {
color:#47a;
}
a:active, a:hover {
color:#69c;
}
#legend li.externalLink {
background: url(../images/external.png) left top no-repeat;
padding-left: 18px;
}
a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover {
background: url(../images/external.png) right center no-repeat;
padding-right: 18px;
}
#legend li.newWindow {
background: url(../images/newwindow.png) left top no-repeat;
padding-left: 18px;
}
a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover {
background: url(../images/newwindow.png) right center no-repeat;
padding-right: 18px;
}
h2 {
padding: 4px 4px 4px 6px;
border: 1px solid #999;
color: #900;
background-color: #ddd;
font-weight:900;
font-size: x-large;
}
h3 {
padding: 4px 4px 4px 6px;
border: 1px solid #aaa;
color: #900;
background-color: #eee;
font-weight: normal;
font-size: large;
}
h4 {
padding: 4px 4px 4px 6px;
border: 1px solid #bbb;
color: #900;
background-color: #fff;
font-weight: normal;
font-size: large;
}
h5 {
padding: 4px 4px 4px 6px;
color: #900;
font-size: medium;
}
p {
line-height: 1.3em;
font-size: small;
}
#breadcrumbs {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
background-color: #ccc;
}
#leftColumn {
margin: 10px 0 0 5px;
border: 1px solid #999;
background-color: #eee;
padding-bottom: 3px; /* IE-9 scrollbar-fix */
}
#navcolumn h5 {
font-size: smaller;
border-bottom: 1px solid #aaaaaa;
padding-top: 2px;
color: #000;
}
table.bodyTable th {
color: white;
background-color: #bbb;
text-align: left;
font-weight: bold;
}
table.bodyTable th, table.bodyTable td {
font-size: 1em;
}
table.bodyTable tr.a {
background-color: #ddd;
}
table.bodyTable tr.b {
background-color: #eee;
}
.source {
border: 1px solid #999;
}
dl {
padding: 4px 4px 4px 6px;
border: 1px solid #aaa;
background-color: #ffc;
}
dt {
color: #900;
}
#organizationLogo img, #projectLogo img, #projectLogo span{
margin: 8px;
}
#banner {
border-bottom: 1px solid #fff;
}
.errormark, .warningmark, .donemark, .infomark {
background: url(../images/icon_error_sml.gif) no-repeat;
}
.warningmark {
background-image: url(../images/icon_warning_sml.gif);
}
.donemark {
background-image: url(../images/icon_success_sml.gif);
}
.infomark {
background-image: url(../images/icon_info_sml.gif);
}

View File

@ -0,0 +1,26 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn {
display: none !important;
}
#bodyColumn, body.docs div.docs {
margin: 0 !important;
border: none !important
}

View File

@ -0,0 +1 @@
/* You can override this file with your own styles */

View File

@ -0,0 +1,4 @@
io.dapr.workflows
io.dapr.workflows.client
io.dapr.workflows.internal
io.dapr.workflows.runtime

View File

@ -0,0 +1,186 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Wed Apr 30 13:51:53 UTC 2025 -->
<title>API Help (dapr-sdk-workflows 0.14.1 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2025-04-30">
<meta name="description" content="help">
<meta name="generator" content="javadoc/HelpWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="help-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li class="nav-bar-cell1-rev">Help</li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Help:&nbsp;</li>
<li><a href="#help-navigation">Navigation</a>&nbsp;|&nbsp;</li>
<li><a href="#help-pages">Pages</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<h1 class="title">JavaDoc Help</h1>
<ul class="help-toc">
<li><a href="#help-navigation">Navigation</a>:
<ul class="help-subtoc">
<li><a href="#help-search">Search</a></li>
</ul>
</li>
<li><a href="#help-pages">Kinds of Pages</a>:
<ul class="help-subtoc">
<li><a href="#overview">Overview</a></li>
<li><a href="#package">Package</a></li>
<li><a href="#class">Class or Interface</a></li>
<li><a href="#doc-file">Other Files</a></li>
<li><a href="#use">Use</a></li>
<li><a href="#tree">Tree (Class Hierarchy)</a></li>
<li><a href="#all-packages">All Packages</a></li>
<li><a href="#all-classes">All Classes and Interfaces</a></li>
<li><a href="#index">Index</a></li>
</ul>
</li>
</ul>
<hr>
<div class="sub-title">
<h2 id="help-navigation">Navigation</h2>
Starting from the <a href="index.html">Overview</a> page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The <a href="index-all.html">Index</a> and Search box allow you to navigate to specific declarations and summary pages, including: <a href="allpackages-index.html">All Packages</a>, <a href="allclasses-index.html">All Classes and Interfaces</a>
<section class="help-section" id="help-search">
<h3>Search</h3>
<p>You can search for definitions of modules, packages, types, fields, methods, system properties and other terms defined in the API, using some or all of the name, optionally using "camelCase" abbreviations. For example:</p>
<ul class="help-section-list">
<li><code>j.l.obj</code> will match "java.lang.Object"</li>
<li><code>InpStr</code> will match "java.io.InputStream"</li>
<li><code>HM.cK</code> will match "java.util.HashMap.containsKey(Object)"</li>
</ul>
<p>Refer to the <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/javadoc/javadoc-search-spec.html">Javadoc Search Specification</a> for a full description of search features.</p>
</section>
</div>
<hr>
<div class="sub-title">
<h2 id="help-pages">Kinds of Pages</h2>
The following sections describe the different kinds of pages in this collection.
<section class="help-section" id="overview">
<h3>Overview</h3>
<p>The <a href="index.html">Overview</a> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</p>
</section>
<section class="help-section" id="package">
<h3>Package</h3>
<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:</p>
<ul class="help-section-list">
<li>Interfaces</li>
<li>Classes</li>
<li>Enums</li>
<li>Exceptions</li>
<li>Errors</li>
<li>Annotation Types</li>
</ul>
</section>
<section class="help-section" id="class">
<h3>Class or Interface</h3>
<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.</p>
<ul class="help-section-list">
<li>Class Inheritance Diagram</li>
<li>Direct Subclasses</li>
<li>All Known Subinterfaces</li>
<li>All Known Implementing Classes</li>
<li>Class or Interface Declaration</li>
<li>Class or Interface Description</li>
</ul>
<br>
<ul class="help-section-list">
<li>Nested Class Summary</li>
<li>Enum Constant Summary</li>
<li>Field Summary</li>
<li>Property Summary</li>
<li>Constructor Summary</li>
<li>Method Summary</li>
<li>Required Element Summary</li>
<li>Optional Element Summary</li>
</ul>
<br>
<ul class="help-section-list">
<li>Enum Constant Details</li>
<li>Field Details</li>
<li>Property Details</li>
<li>Constructor Details</li>
<li>Method Details</li>
<li>Element Details</li>
</ul>
<p><span class="help-note">Note:</span> Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.</p>
<p>The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>
</section>
<section class="help-section" id="doc-file">
<h3>Other Files</h3>
<p>Packages and modules may contain pages with additional information related to the declarations nearby.</p>
</section>
<section class="help-section" id="use">
<h3>Use</h3>
<p>Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the USE link in the navigation bar.</p>
</section>
<section class="help-section" id="tree">
<h3>Tree (Class Hierarchy)</h3>
<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with <code>java.lang.Object</code>. Interfaces do not inherit from <code>java.lang.Object</code>.</p>
<ul class="help-section-list">
<li>When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.</li>
<li>When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.</li>
</ul>
</section>
<section class="help-section" id="all-packages">
<h3>All Packages</h3>
<p>The <a href="allpackages-index.html">All Packages</a> page contains an alphabetic index of all packages contained in the documentation.</p>
</section>
<section class="help-section" id="all-classes">
<h3>All Classes and Interfaces</h3>
<p>The <a href="allclasses-index.html">All Classes and Interfaces</a> page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.</p>
</section>
<section class="help-section" id="index">
<h3>Index</h3>
<p>The <a href="index-all.html">Index</a> contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as <a href="allpackages-index.html">All Packages</a>, <a href="allclasses-index.html">All Classes and Interfaces</a>.</p>
</section>
</div>
<hr>
<span class="help-footnote">This help file applies to API documentation generated by the standard doclet.</span></main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2025. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Some files were not shown because too many files have changed in this diff Show More