* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
@ -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:
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)
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).
> 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.
* 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.
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)"/>
<messagekey="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
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)"/>
<messagekey="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
@ -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.
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.
Next, import the Java SDK packages to get started. Select your preferred build tool to learn how to import.
{{<tabsMavenGradle>}}
{{% 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
- 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()) {
- 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()) {
- 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. |
- 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.
- 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
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
- 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()) {
- 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()) {
- 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"
- 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 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
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.
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.
== 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, you’ll 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 >}})
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:
- 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()) {
- 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()) {
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"
- 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.
- 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
- 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
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:
| `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.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:
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:
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
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.
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.
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.
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
---
Let’s 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.
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 {
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 >}})
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
<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:
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){
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`:
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`.
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){
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:
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.
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/).
<divclass="block">Common interface for task activity implementations.</div>
</div>
<divclass="col-first even-row-color all-classes-table all-classes-table-tab2"><ahref="io/dapr/workflows/runtime/WorkflowActivityClassWrapper.html"title="class in io.dapr.workflows.runtime">WorkflowActivityClassWrapper</a><<ahref="io/dapr/workflows/runtime/WorkflowActivityClassWrapper.html"title="type parameter in WorkflowActivityClassWrapper">T</a> extends <ahref="io/dapr/workflows/WorkflowActivity.html"title="interface in io.dapr.workflows">WorkflowActivity</a>></div>
<divclass="col-first even-row-color all-classes-table all-classes-table-tab2"><ahref="io/dapr/workflows/runtime/WorkflowActivityInstanceWrapper.html"title="class in io.dapr.workflows.runtime">WorkflowActivityInstanceWrapper</a><<ahref="io/dapr/workflows/runtime/WorkflowActivityInstanceWrapper.html"title="type parameter in WorkflowActivityInstanceWrapper">T</a> extends <ahref="io/dapr/workflows/WorkflowActivity.html"title="interface in io.dapr.workflows">WorkflowActivity</a>></div>
<li><ahref="#all-classes">All Classes and Interfaces</a></li>
<li><ahref="#index">Index</a></li>
</ul>
</li>
</ul>
<hr>
<divclass="sub-title">
<h2id="help-navigation">Navigation</h2>
Starting from the <ahref="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 <ahref="index-all.html">Index</a> and Search box allow you to navigate to specific declarations and summary pages, including: <ahref="allpackages-index.html">All Packages</a>, <ahref="allclasses-index.html">All Classes and Interfaces</a>
<sectionclass="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>
<ulclass="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 <ahref="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>
<divclass="sub-title">
<h2id="help-pages">Kinds of Pages</h2>
The following sections describe the different kinds of pages in this collection.
<sectionclass="help-section"id="overview">
<h3>Overview</h3>
<p>The <ahref="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>
<sectionclass="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>
<ulclass="help-section-list">
<li>Interfaces</li>
<li>Classes</li>
<li>Enums</li>
<li>Exceptions</li>
<li>Errors</li>
<li>Annotation Types</li>
</ul>
</section>
<sectionclass="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>
<ulclass="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>
<ulclass="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>
<ulclass="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><spanclass="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>
<sectionclass="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>
<sectionclass="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>
<sectionclass="help-section"id="tree">
<h3>Tree (Class Hierarchy)</h3>
<p>There is a <ahref="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>
<ulclass="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>
<sectionclass="help-section"id="all-packages">
<h3>All Packages</h3>
<p>The <ahref="allpackages-index.html">All Packages</a> page contains an alphabetic index of all packages contained in the documentation.</p>
</section>
<sectionclass="help-section"id="all-classes">
<h3>All Classes and Interfaces</h3>
<p>The <ahref="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>
<sectionclass="help-section"id="index">
<h3>Index</h3>
<p>The <ahref="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 <ahref="allpackages-index.html">All Packages</a>, <ahref="allclasses-index.html">All Classes and Interfaces</a>.</p>
</section>
</div>
<hr>
<spanclass="help-footnote">This help file applies to API documentation generated by the standard doclet.</span></main>
<footerrole="contentinfo">
<hr>
<pclass="legal-copy"><small>Copyright © 2025. All rights reserved.</small></p>