├── .gitmodules ├── sdk-autogen └── src │ ├── main │ └── java │ │ └── .keepme │ └── test │ └── java │ └── .keepme ├── sdk-tests ├── components │ ├── secret.json │ ├── pubsub.yaml │ ├── redisconfigstore.yaml │ ├── statestore.yaml │ ├── secretstore.yaml │ ├── mongo-statestore.yml │ ├── http_binding.yaml │ └── kafka_bindings.yaml ├── .hashicorp_vault_token ├── src │ └── test │ │ ├── resources │ │ ├── query.json │ │ └── logback.xml │ │ └── java │ │ └── io │ │ └── dapr │ │ ├── it │ │ ├── spring │ │ │ └── data │ │ │ │ ├── DaprSpringDataConstants.java │ │ │ │ ├── CustomMySQLContainer.java │ │ │ │ └── TestTypeRepository.java │ │ ├── testcontainers │ │ │ ├── ContainerConstants.java │ │ │ ├── DaprClientFactory.java │ │ │ ├── actors │ │ │ │ ├── TestActor.java │ │ │ │ ├── TestActorImpl.java │ │ │ │ └── TestActorsApplication.java │ │ │ ├── jobs │ │ │ │ └── TestJobsApplication.java │ │ │ ├── pubsub │ │ │ │ ├── http │ │ │ │ │ └── TestPubSubApplication.java │ │ │ │ └── outbox │ │ │ │ │ └── TestPubsubOutboxApplication.java │ │ │ ├── workflows │ │ │ │ ├── TestWorkflowsApplication.java │ │ │ │ ├── FirstActivity.java │ │ │ │ └── SecondActivity.java │ │ │ └── conversations │ │ │ │ └── TestConversationApplication.java │ │ ├── Stoppable.java │ │ ├── tracing │ │ │ └── http │ │ │ │ ├── Controller.java │ │ │ │ └── OpenTelemetryInterceptorConfig.java │ │ ├── actors │ │ │ ├── services │ │ │ │ └── springboot │ │ │ │ │ ├── DemoActor.java │ │ │ │ │ ├── StatefulActor.java │ │ │ │ │ └── DaprApplication.java │ │ │ └── app │ │ │ │ ├── MyActorStringImpl.java │ │ │ │ ├── MyActorBinaryImpl.java │ │ │ │ ├── MyActorObjectImpl.java │ │ │ │ ├── TestApplication.java │ │ │ │ └── MyObject.java │ │ ├── api │ │ │ └── ApiIT.java │ │ ├── DaprRunConfig.java │ │ ├── methodinvoke │ │ │ └── http │ │ │ │ └── Person.java │ │ └── Retry.java │ │ └── actors │ │ └── runtime │ │ └── DaprClientHttpUtils.java ├── configurations │ └── configuration.yaml └── deploy │ └── local-test.yml ├── docs ├── css │ ├── site.css │ └── print.css ├── module-search-index.js ├── dapr-sdk-workflows │ ├── tag-search-index.js │ ├── css │ │ ├── site.css │ │ └── print.css │ ├── module-search-index.js │ ├── resources │ │ ├── x.png │ │ └── glass.png │ ├── images │ │ ├── collapsed.gif │ │ ├── expanded.gif │ │ ├── external.png │ │ ├── newwindow.png │ │ ├── icon_error_sml.gif │ │ ├── icon_info_sml.gif │ │ ├── icon_success_sml.gif │ │ ├── icon_warning_sml.gif │ │ └── logos │ │ │ ├── maven-feather.png │ │ │ ├── build-by-maven-black.png │ │ │ └── build-by-maven-white.png │ ├── element-list │ ├── package-search-index.js │ ├── overview-summary.html │ └── legal │ │ └── jquery.md ├── dapr-sdk-springboot │ ├── css │ │ ├── site.css │ │ └── print.css │ └── images │ │ ├── expanded.gif │ │ ├── external.png │ │ ├── collapsed.gif │ │ ├── newwindow.png │ │ ├── icon_info_sml.gif │ │ ├── icon_error_sml.gif │ │ ├── icon_success_sml.gif │ │ ├── icon_warning_sml.gif │ │ └── logos │ │ ├── maven-feather.png │ │ ├── build-by-maven-black.png │ │ └── build-by-maven-white.png ├── resources │ ├── x.png │ └── glass.png ├── images │ ├── expanded.gif │ ├── external.png │ ├── collapsed.gif │ ├── newwindow.png │ ├── icon_info_sml.gif │ ├── icon_error_sml.gif │ ├── icon_success_sml.gif │ ├── icon_warning_sml.gif │ └── logos │ │ ├── maven-feather.png │ │ ├── build-by-maven-black.png │ │ └── build-by-maven-white.png ├── tag-search-index.js ├── overview-summary.html ├── element-list ├── legal │ └── jquery.md └── package-search-index.js ├── sdk ├── src │ ├── main │ │ ├── resources │ │ │ └── sdk_version.properties │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ ├── client │ │ │ ├── domain │ │ │ │ ├── FailurePolicyType.java │ │ │ │ ├── FailurePolicy.java │ │ │ │ ├── BulkSubscribeAppResponseStatus.java │ │ │ │ ├── Metadata.java │ │ │ │ ├── HttpEndpointMetadata.java │ │ │ │ ├── GetJobRequest.java │ │ │ │ ├── query │ │ │ │ │ └── Pagination.java │ │ │ │ ├── DeleteJobRequest.java │ │ │ │ ├── DropFailurePolicy.java │ │ │ │ ├── ConversationMessageContent.java │ │ │ │ ├── ActorMetadata.java │ │ │ │ ├── ConversationTools.java │ │ │ │ └── RuleMetadata.java │ │ │ ├── Headers.java │ │ │ └── resiliency │ │ │ │ └── ResiliencyOptions.java │ │ │ ├── config │ │ │ ├── StringProperty.java │ │ │ ├── BooleanProperty.java │ │ │ ├── IntegerProperty.java │ │ │ ├── SecondsDurationProperty.java │ │ │ ├── MillisecondsDurationProperty.java │ │ │ └── GenericProperty.java │ │ │ └── serializer │ │ │ └── CustomizableObjectSerializer.java │ └── test │ │ ├── resources │ │ └── mockito-extensions │ │ │ └── org.mockito.plugins.MockMaker │ │ └── java │ │ └── io │ │ └── dapr │ │ ├── client │ │ ├── domain │ │ │ ├── GetSecretRequestTest.java │ │ │ ├── GetStateRequestTest.java │ │ │ ├── GetBulkSecretRequestTest.java │ │ │ ├── InvokeBindingRequestTest.java │ │ │ ├── DeleteStateRequestTest.java │ │ │ └── PublishEventRequestTest.java │ │ └── DaprClientTestBuilder.java │ │ ├── utils │ │ └── TypeRefTest.java │ │ └── runtime │ │ ├── MethodListener.java │ │ └── TopicListener.java └── spotbugs-exclude.xml ├── sdk-actors ├── src │ ├── test │ │ ├── resources │ │ │ └── mockito-extensions │ │ │ │ └── org.mockito.plugins.MockMaker │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── actors │ │ │ └── client │ │ │ ├── DaprClientStub.java │ │ │ └── ActorProxyImplForTests.java │ └── main │ │ └── java │ │ └── io │ │ └── dapr │ │ └── actors │ │ ├── Undefined.java │ │ ├── runtime │ │ ├── ActorCallType.java │ │ └── ActorFactory.java │ │ ├── ActorType.java │ │ └── client │ │ └── DaprClient.java └── spotbugs-exclude.xml ├── .mise.toml ├── spring-boot-examples ├── consumer-app │ └── src │ │ ├── test │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── springboot │ │ │ └── examples │ │ │ └── consumer │ │ │ └── TestConsumerApplication.java │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── io │ │ └── dapr │ │ └── springboot │ │ └── examples │ │ └── consumer │ │ └── ConsumerApplication.java ├── workflows │ ├── multi-app │ │ ├── orchestrator │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── dapr │ │ │ │ │ └── springboot │ │ │ │ │ └── examples │ │ │ │ │ └── orchestrator │ │ │ │ │ └── OrchestratorApplication.java │ │ │ │ └── test │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── dapr │ │ │ │ └── springboot │ │ │ │ └── examples │ │ │ │ └── orchestrator │ │ │ │ ├── DockerImages.java │ │ │ │ └── TestOrchestratorApplication.java │ │ ├── worker-one │ │ │ └── src │ │ │ │ ├── test │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── dapr │ │ │ │ │ └── springboot │ │ │ │ │ └── examples │ │ │ │ │ └── workerone │ │ │ │ │ └── TestWorkerOneApplication.java │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── dapr │ │ │ │ └── springboot │ │ │ │ └── examples │ │ │ │ └── workerone │ │ │ │ └── WorkerOneApplication.java │ │ ├── worker-two │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── dapr │ │ │ │ │ └── springboot │ │ │ │ │ └── examples │ │ │ │ │ └── workertwo │ │ │ │ │ └── WorkerTwoApplication.java │ │ │ │ └── test │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── dapr │ │ │ │ └── springboot │ │ │ │ └── examples │ │ │ │ └── workertwo │ │ │ │ └── TestWorkerTwoApplication.java │ │ └── spotbugs-exclude.xml │ ├── patterns │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── dapr │ │ │ │ │ └── springboot │ │ │ │ │ └── examples │ │ │ │ │ └── wfp │ │ │ │ │ ├── WorkflowPatternsApplication.java │ │ │ │ │ ├── continueasnew │ │ │ │ │ └── CleanUpLog.java │ │ │ │ │ ├── fanoutin │ │ │ │ │ └── Result.java │ │ │ │ │ ├── externalevent │ │ │ │ │ └── Decision.java │ │ │ │ │ └── timer │ │ │ │ │ └── TimerLogService.java │ │ │ └── test │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── dapr │ │ │ │ └── springboot │ │ │ │ └── examples │ │ │ │ └── wfp │ │ │ │ └── TestWorkflowPatternsApplication.java │ │ └── body.json │ └── spotbugs-exclude.xml ├── producer-app │ └── src │ │ ├── test │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── springboot │ │ │ └── examples │ │ │ └── producer │ │ │ └── TestProducerApplication.java │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── io │ │ └── dapr │ │ └── springboot │ │ └── examples │ │ └── producer │ │ ├── OrderDTO.java │ │ ├── OrderRepository.java │ │ ├── ProducerApplication.java │ │ └── CustomerStore.java ├── spotbugs-exclude.xml └── kubernetes │ ├── pubsub.yaml │ ├── kvbinding.yaml │ ├── kvstore.yaml │ ├── consumer-app.yaml │ └── producer-app.yaml ├── CODEOWNERS ├── .sdkmanrc ├── examples ├── src │ └── main │ │ ├── resources │ │ ├── img │ │ │ ├── zipkin-result.png │ │ │ ├── zipkin-details.png │ │ │ ├── zipkin-landing.png │ │ │ ├── zipkin-pubsub-details.png │ │ │ ├── zipkin-pubsub-landing.png │ │ │ ├── zipkin-pubsub-result.png │ │ │ ├── intellij-integration-test.png │ │ │ ├── zipkin-bulk-publish-details.png │ │ │ └── zipkin-pubsub-details-custom-span.png │ │ └── logback.xml │ │ └── java │ │ └── io │ │ └── dapr │ │ └── examples │ │ ├── state │ │ └── docker-compose-single-mongo.yml │ │ ├── querystate │ │ └── docker-compose-single-mongo.yml │ │ ├── secrets │ │ └── config.yaml │ │ ├── bindings │ │ └── http │ │ │ └── docker-compose-single-kafka.yml │ │ ├── DaprConfig.java │ │ ├── workflows │ │ └── utils │ │ │ └── PropertyUtils.java │ │ ├── jobs │ │ └── DemoJobsSpringApplication.java │ │ ├── actors │ │ └── DemoActor.java │ │ └── OpenTelemetryInterceptorConfig.java ├── components │ ├── conversation │ │ └── conversation.yaml │ ├── lock │ │ └── redis_lockstore.yaml │ ├── configuration │ │ └── redis_configstore.yaml │ ├── actors │ │ └── redis.yaml │ ├── state │ │ ├── redis.yaml │ │ └── mongo.yaml │ ├── workflows │ │ └── redis.yaml │ ├── pubsub │ │ └── redis_messagebus.yaml │ ├── secrets │ │ └── local_file.yaml │ └── bindings │ │ └── kafka_bindings.yaml ├── spotbugs-exclude.xml └── proto │ └── helloworld.proto ├── sdk-springboot ├── src │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── springboot │ │ │ ├── DaprAutoConfiguration.java │ │ │ └── DaprTopicRoutes.java │ └── test │ │ └── java │ │ └── io │ │ └── dapr │ │ └── springboot │ │ └── MockStringValueResolver.java └── spotbugs-exclude.xml ├── .github ├── holopin.yml ├── ISSUE_TEMPLATE │ ├── discussion.md │ ├── proposal.md │ ├── question.md │ ├── feature_request.md │ └── bug_report.md ├── pull_request_template.md ├── workflows │ ├── validate-docs.yml │ ├── dapr_bot.yml │ └── automerge-bot.yml ├── scripts │ ├── update_sdk_version.sh │ └── update_docs.sh └── dependabot.yml ├── .codecov.yaml ├── sdk-workflows ├── spotbugs-exclude.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── dapr │ │ └── workflows │ │ ├── WorkflowStub.java │ │ ├── WorkflowActivityContext.java │ │ ├── WorkflowTaskRetryHandler.java │ │ └── Workflow.java │ └── test │ └── java │ └── io │ └── dapr │ └── workflows │ └── client │ └── NewWorkflowOptionsTest.java ├── dapr-spring ├── dapr-spring-boot-autoconfigure │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── spring │ │ │ └── boot │ │ │ └── autoconfigure │ │ │ └── client │ │ │ └── DaprConnectionDetails.java │ │ └── test │ │ └── java │ │ └── io │ │ └── dapr │ │ └── spring │ │ └── boot │ │ └── autoconfigure │ │ └── client │ │ ├── workflows │ │ ├── TestActivity.java │ │ └── TestWorkflow.java │ │ └── WorkflowTestApplication.java ├── dapr-spring-boot-tests │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── spring.factories ├── spotbugs-exclude.xml ├── dapr-spring-data │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── dapr │ │ │ └── spring │ │ │ └── data │ │ │ └── KeyValueAdapterResolver.java │ └── pom.xml ├── dapr-spring-workflows │ └── src │ │ └── main │ │ └── java │ │ └── io │ │ └── dapr │ │ └── spring │ │ └── workflows │ │ └── config │ │ └── EnableDaprWorkflows.java └── dapr-spring-messaging │ └── pom.xml ├── testcontainers-dapr └── src │ ├── test │ └── resources │ │ └── dapr-resources │ │ └── statestore.yaml │ └── main │ └── java │ └── io │ └── dapr │ └── testcontainers │ ├── DaprLogLevel.java │ ├── converter │ └── YamlConverter.java │ ├── ConfigurationSettings.java │ ├── DaprProtocol.java │ ├── DaprContainerConstants.java │ ├── HttpEndpoint.java │ ├── ZipkinTracingConfigurationSettings.java │ ├── ListEntry.java │ ├── MetadataEntry.java │ └── AppHttpPipeline.java ├── .java_header ├── settings.xml ├── .gitignore ├── durabletask-client └── src │ └── main │ └── java │ └── io │ └── dapr │ └── durabletask │ ├── NonDeterministicOrchestratorException.java │ ├── TaskActivityFactory.java │ ├── TaskOrchestrationFactory.java │ └── TaskCanceledException.java └── .mvn └── wrapper └── maven-wrapper.properties /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sdk-autogen/src/main/java/.keepme: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sdk-autogen/src/test/java/.keepme: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sdk-tests/components/secret.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /sdk-tests/.hashicorp_vault_token: -------------------------------------------------------------------------------- 1 | myroot 2 | -------------------------------------------------------------------------------- /docs/css/site.css: -------------------------------------------------------------------------------- 1 | /* You can override this file with your own styles */ -------------------------------------------------------------------------------- /docs/module-search-index.js: -------------------------------------------------------------------------------- 1 | moduleSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /sdk/src/main/resources/sdk_version.properties: -------------------------------------------------------------------------------- 1 | sdk_version=${project.version} 2 | -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/css/site.css: -------------------------------------------------------------------------------- 1 | /* You can override this file with your own styles */ -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/css/site.css: -------------------------------------------------------------------------------- 1 | /* You can override this file with your own styles */ -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/module-search-index.js: -------------------------------------------------------------------------------- 1 | moduleSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/resources/x.png -------------------------------------------------------------------------------- /sdk/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /docs/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/expanded.gif -------------------------------------------------------------------------------- /docs/images/external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/external.png -------------------------------------------------------------------------------- /docs/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/resources/glass.png -------------------------------------------------------------------------------- /docs/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/collapsed.gif -------------------------------------------------------------------------------- /docs/images/newwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/newwindow.png -------------------------------------------------------------------------------- /sdk-actors/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /docs/images/icon_info_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/icon_info_sml.gif -------------------------------------------------------------------------------- /docs/images/icon_error_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/icon_error_sml.gif -------------------------------------------------------------------------------- /docs/images/icon_success_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/icon_success_sml.gif -------------------------------------------------------------------------------- /docs/images/icon_warning_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/icon_warning_sml.gif -------------------------------------------------------------------------------- /.mise.toml: -------------------------------------------------------------------------------- 1 | [tools] 2 | java = "temurin-17" 3 | 4 | [env] 5 | JAVA_HOME = "{{exec(command='mise where java')}}" 6 | -------------------------------------------------------------------------------- /docs/images/logos/maven-feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/logos/maven-feather.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/resources/x.png -------------------------------------------------------------------------------- /spring-boot-examples/consumer-app/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.pubsub.name=pubsub 2 | server.port=8081 3 | -------------------------------------------------------------------------------- /docs/images/logos/build-by-maven-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/logos/build-by-maven-black.png -------------------------------------------------------------------------------- /docs/images/logos/build-by-maven-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/images/logos/build-by-maven-white.png -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/orchestrator/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=orchestrator -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=workflow-patterns-app 2 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=workflow-patterns-app 2 | -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/expanded.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/external.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/collapsed.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/expanded.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/external.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/newwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/newwindow.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/resources/glass.png -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners are the maintainers and approvers of this repo 2 | * @dapr/maintainers-java-sdk @dapr/approvers-java-sdk 3 | -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/collapsed.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/newwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/newwindow.png -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-one/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.statestore.name=kvstore 2 | server.port=8081 -------------------------------------------------------------------------------- /.sdkmanrc: -------------------------------------------------------------------------------- 1 | # Enable auto-env through the sdkman_auto_env config 2 | # Add key=value pairs of SDKs to use below 3 | java=17.0.11-tem 4 | maven=3.8.5 -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/icon_info_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/icon_info_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/element-list: -------------------------------------------------------------------------------- 1 | io.dapr.workflows 2 | io.dapr.workflows.client 3 | io.dapr.workflows.internal 4 | io.dapr.workflows.runtime 5 | -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/icon_error_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/icon_error_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/icon_info_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/icon_info_sml.gif -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-result.png -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/orchestrator/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.statestore.name=kvstore 2 | server.port=8080 -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-one/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=worker-one 2 | server.port=8081 -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-two/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=worker-two 2 | server.port=8082 -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-two/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.statestore.name=kvstore 2 | server.port=8082 3 | -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/icon_error_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/icon_error_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/icon_success_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/icon_success_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/icon_warning_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/icon_warning_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/icon_success_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/icon_success_sml.gif -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/icon_warning_sml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/icon_warning_sml.gif -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-details.png -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-landing.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/logos/maven-feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/logos/maven-feather.png -------------------------------------------------------------------------------- /sdk-springboot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | io.dapr.springboot.DaprAutoConfiguration -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/logos/maven-feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/logos/maven-feather.png -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/state/docker-compose-single-mongo.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mongo: 3 | image: mongo 4 | ports: 5 | - "27017:27017" -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-pubsub-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-pubsub-details.png -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-pubsub-landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-pubsub-landing.png -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-pubsub-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-pubsub-result.png -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/querystate/docker-compose-single-mongo.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mongo: 3 | image: mongo 4 | ports: 5 | - "27017:27017" -------------------------------------------------------------------------------- /.github/holopin.yml: -------------------------------------------------------------------------------- 1 | organization: dapr 2 | defaultSticker: clrqfdv4x24910fl5n4iwu5oa 3 | stickers: 4 | - 5 | id: clrqfdv4x24910fl5n4iwu5oa 6 | alias: sdk-badge 7 | -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/logos/build-by-maven-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/logos/build-by-maven-black.png -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/images/logos/build-by-maven-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-springboot/images/logos/build-by-maven-white.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/logos/build-by-maven-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/logos/build-by-maven-black.png -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/images/logos/build-by-maven-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/docs/dapr-sdk-workflows/images/logos/build-by-maven-white.png -------------------------------------------------------------------------------- /examples/src/main/resources/img/intellij-integration-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/intellij-integration-test.png -------------------------------------------------------------------------------- /spring-boot-examples/consumer-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.pubsub.name=pubsub 2 | spring.application.name=consumer-app 3 | server.port=8081 4 | 5 | -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-bulk-publish-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-bulk-publish-details.png -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | dapr.statestore.name=kvstore 2 | dapr.statestore.binding=kvbinding 3 | dapr.pubsub.name=pubsub 4 | -------------------------------------------------------------------------------- /.codecov.yaml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - examples 3 | - sdk-tests 4 | - sdk-autogen 5 | comment: 6 | # Delete old comment and post new one for new coverage information. 7 | behavior: new 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/discussion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Start a discussion for java-sdk 4 | title: '' 5 | labels: kind/discussion 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /docs/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"},{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults(); -------------------------------------------------------------------------------- /examples/src/main/resources/img/zipkin-pubsub-details-custom-span.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapr/java-sdk/HEAD/examples/src/main/resources/img/zipkin-pubsub-details-custom-span.png -------------------------------------------------------------------------------- /examples/components/conversation/conversation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: echo 5 | spec: 6 | type: conversation.echo 7 | version: v1 8 | -------------------------------------------------------------------------------- /sdk/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sdk-actors/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sdk-workflows/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sdk-springboot/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Proposal 3 | about: Create a proposal for java-sdk 4 | title: '' 5 | labels: kind/proposal 6 | assignees: '' 7 | 8 | --- 9 | ## Describe the proposal 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about java-sdk 4 | title: '' 5 | labels: kind/question 6 | assignees: '' 7 | 8 | --- 9 | ## Ask your question here 10 | -------------------------------------------------------------------------------- /sdk-tests/src/test/resources/query.json: -------------------------------------------------------------------------------- 1 | { 2 | "filter": { 3 | "EQ": { 4 | "content": "test" 5 | } 6 | }, 7 | "page": { 8 | "limit": 0, 9 | "token": "0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | io.dapr.spring.boot.autoconfigure.client.DaprClientAutoConfiguration 2 | -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=producer-app 2 | dapr.pubsub.name=pubsub 3 | dapr.statestore.name=kvstore 4 | dapr.statestore.binding=kvbinding 5 | -------------------------------------------------------------------------------- /spring-boot-examples/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-tests/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\ 2 | io.dapr.spring.boot.testcontainers.service.connection.DaprContainerConnectionDetailsFactory 3 | -------------------------------------------------------------------------------- /sdk-tests/configurations/configuration.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Configuration 3 | metadata: 4 | name: testconfiguration 5 | spec: 6 | tracing: 7 | samplingRate: "1" 8 | zipkin: 9 | endpointAddress: http://localhost:9411/api/v2/spans -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"io.dapr.workflows"},{"l":"io.dapr.workflows.client"},{"l":"io.dapr.workflows.internal"},{"l":"io.dapr.workflows.runtime"}];updateSearchResults(); -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/orchestrator/src/test/java/io/dapr/springboot/examples/orchestrator/DockerImages.java: -------------------------------------------------------------------------------- 1 | package io.dapr.springboot.examples.orchestrator; 2 | 3 | public interface DockerImages { 4 | 5 | String JDK_17_TEMURIN_JAMMY = "eclipse-temurin:17-jdk-jammy"; 6 | } 7 | -------------------------------------------------------------------------------- /sdk-tests/components/pubsub.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: messagebus 5 | spec: 6 | type: pubsub.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | -------------------------------------------------------------------------------- /examples/components/lock/redis_lockstore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: lockstore 5 | spec: 6 | type: lock.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/secrets/config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Configuration 3 | metadata: 4 | name: daprConfig 5 | spec: 6 | secrets: 7 | scopes: 8 | - storeName: "localSecretStore" 9 | defaultAccess: "deny" 10 | allowedSecrets: ["redisPassword"] 11 | -------------------------------------------------------------------------------- /sdk-tests/components/redisconfigstore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: redisconfigstore 5 | spec: 6 | type: configuration.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | -------------------------------------------------------------------------------- /examples/components/configuration/redis_configstore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: configstore 5 | spec: 6 | type: configuration.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | -------------------------------------------------------------------------------- /dapr-spring/spotbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/spring/data/DaprSpringDataConstants.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.spring.data; 2 | 3 | public class DaprSpringDataConstants { 4 | private DaprSpringDataConstants() { 5 | } 6 | 7 | public static final String STATE_STORE_NAME = "kvstore"; 8 | public static final String BINDING_NAME = "kvbinding"; 9 | } 10 | -------------------------------------------------------------------------------- /examples/components/actors/redis.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | - name: actorStateStore 14 | value: "true" 15 | -------------------------------------------------------------------------------- /examples/components/state/redis.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | - name: actorStateStore 14 | value: "true" 15 | -------------------------------------------------------------------------------- /sdk-tests/components/statestore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | - name: actorStateStore 14 | value: "true" 15 | -------------------------------------------------------------------------------- /examples/components/workflows/redis.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | - name: actorStateStore 14 | value: "true" 15 | -------------------------------------------------------------------------------- /examples/components/state/mongo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: mongo-statestore 5 | spec: 6 | type: state.mongodb 7 | version: v1 8 | metadata: 9 | - name: host 10 | value: localhost:27017 11 | - name: databaseName 12 | value: local 13 | - name: collectionName 14 | value: propertyCollection -------------------------------------------------------------------------------- /testcontainers-dapr/src/test/resources/dapr-resources/statestore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: statestore 5 | spec: 6 | type: state.redis 7 | version: v1 8 | metadata: 9 | - name: keyPrefix 10 | value: name 11 | - name: redisHost 12 | value: redis:6379 13 | - name: redisPassword 14 | value: "" 15 | -------------------------------------------------------------------------------- /sdk-tests/components/secretstore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: localSecretStore 5 | spec: 6 | type: secretstores.local.file 7 | version: v1 8 | metadata: 9 | - name: secretsFile 10 | value: "./components/secret.json" 11 | - name: nestedSeparator 12 | value: ":" 13 | - name: multiValued 14 | value: "true" 15 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/body.json: -------------------------------------------------------------------------------- 1 | ["Hello, world!", 2 | "The quick brown fox jumps over the lazy dog.", 3 | "If a tree falls in the forest and there is no one there to hear it, does it make a sound?", 4 | "The greatest glory in living lies not in never falling, but in rising every time we fall.", 5 | "Always remember that you are absolutely unique. Just like everyone else."] 6 | -------------------------------------------------------------------------------- /examples/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d {HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sdk-tests/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/components/pubsub/redis_messagebus.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: messagebus 5 | spec: 6 | type: pubsub.redis 7 | version: v1 8 | metadata: 9 | - name: redisHost 10 | value: localhost:6379 11 | - name: redisPassword 12 | value: "" 13 | scopes: 14 | - publisher 15 | - bulk-publisher 16 | - subscriber 17 | - publisher-tracing -------------------------------------------------------------------------------- /spring-boot-examples/kubernetes/pubsub.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: pubsub 5 | spec: 6 | type: pubsub.rabbitmq 7 | version: v1 8 | metadata: 9 | - name: connectionString 10 | value: amqp://guest:guest@rabbitmq.default.svc.cluster.local:5672 11 | - name: user 12 | value: guest 13 | - name: password 14 | value: guest 15 | -------------------------------------------------------------------------------- /spring-boot-examples/kubernetes/kvbinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: kvbinding 5 | spec: 6 | type: bindings.postgresql 7 | version: v1 8 | metadata: 9 | - name: connectionString 10 | value: host=postgresql.default.svc.cluster.local user=postgres password=password port=5432 connect_timeout=10 11 | database=dapr 12 | scopes: 13 | - producer-app 14 | -------------------------------------------------------------------------------- /examples/components/secrets/local_file.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: localSecretStore 5 | namespace: default 6 | spec: 7 | type: secretstores.local.file 8 | version: v1 9 | metadata: 10 | - name: secretsFile 11 | value: "./components/secrets/secret.json" 12 | - name: nestedSeparator 13 | value: ":" 14 | - name: multiValued 15 | value: "false" 16 | -------------------------------------------------------------------------------- /sdk-tests/components/mongo-statestore.yml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: mongo-statestore 5 | spec: 6 | type: state.mongodb 7 | version: v1 8 | metadata: 9 | - name: host 10 | value: localhost:27017 11 | - name: databaseName 12 | value: local 13 | - name: collectionName 14 | value: testCollection 15 | scopes: 16 | - grpcstateclientit 17 | - httpstateclientit -------------------------------------------------------------------------------- /spring-boot-examples/kubernetes/kvstore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: kvstore 5 | spec: 6 | type: state.postgresql 7 | version: v1 8 | metadata: 9 | - name: keyPrefix 10 | value: name 11 | - name: actorStateStore 12 | value: 'true' 13 | - name: connectionString 14 | value: host=postgresql.default.svc.cluster.local user=postgres password=password port=5432 connect_timeout=10 15 | database=dapr 16 | scopes: 17 | - producer-app 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | _Please explain the changes you've made_ 4 | 5 | ## Issue reference 6 | 7 | We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation. 8 | 9 | Please reference the issue this PR will close: #_[issue number]_ 10 | 11 | ## Checklist 12 | 13 | Please make sure you've completed the relevant tasks for this PR, out of the following list: 14 | 15 | * [ ] Code compiles correctly 16 | * [ ] Created/updated tests 17 | * [ ] Extended the documentation 18 | -------------------------------------------------------------------------------- /examples/proto/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package daprexamples; 4 | 5 | option java_outer_classname = "DaprExamplesProtos"; 6 | option java_package = "io.dapr.examples"; 7 | 8 | // User Code definitions 9 | service HelloWorld { 10 | // Sends a greeting 11 | rpc SayHello (HelloRequest) returns (HelloReply) {} 12 | } 13 | 14 | // The request message containing the user's name. 15 | message HelloRequest { 16 | string name = 1; 17 | } 18 | 19 | // The response message containing the greetings 20 | message HelloReply { 21 | string message = 1; 22 | } -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/spring/data/CustomMySQLContainer.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.spring.data; 2 | 3 | import org.testcontainers.containers.MySQLContainer; 4 | import org.testcontainers.utility.DockerImageName; 5 | 6 | public class CustomMySQLContainer> extends MySQLContainer { 7 | 8 | public CustomMySQLContainer(String dockerImageName) { 9 | super(DockerImageName.parse(dockerImageName)); 10 | } 11 | 12 | protected void waitUntilContainerStarted() { 13 | this.getWaitStrategy().waitUntilReady(this); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Create a Feature Request for java-sdk 4 | title: '' 5 | labels: kind/enhancement 6 | assignees: '' 7 | 8 | --- 9 | ## Describe the feature 10 | 11 | ## Release Note 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | RELEASE NOTE: 20 | -------------------------------------------------------------------------------- /examples/components/bindings/kafka_bindings.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: sample123 5 | spec: 6 | type: bindings.kafka 7 | version: v1 8 | metadata: 9 | # Kafka broker connection setting 10 | - name: brokers 11 | value: localhost:9092 12 | # consumer configuration: topic and consumer group 13 | - name: topics 14 | value: sample 15 | - name: consumerGroup 16 | value: group1 17 | # publisher configuration: topic 18 | - name: publishTopic 19 | value: sample 20 | - name: authRequired 21 | value: "false" 22 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/ContainerConstants.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.testcontainers; 2 | 3 | import io.dapr.testcontainers.DaprContainerConstants; 4 | 5 | public interface ContainerConstants { 6 | String DAPR_RUNTIME_IMAGE_TAG = DaprContainerConstants.DAPR_RUNTIME_IMAGE_TAG; 7 | String DAPR_PLACEMENT_IMAGE_TAG = DaprContainerConstants.DAPR_PLACEMENT_IMAGE_TAG; 8 | String DAPR_SCHEDULER_IMAGE_TAG = DaprContainerConstants.DAPR_SCHEDULER_IMAGE_TAG; 9 | String TOXI_PROXY_IMAGE_TAG = "ghcr.io/shopify/toxiproxy:2.5.0"; 10 | String JDK_17_TEMURIN_JAMMY = "eclipse-temurin:17-jdk-jammy"; 11 | } 12 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/DaprClientFactory.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.testcontainers; 2 | 3 | import io.dapr.client.DaprClientBuilder; 4 | import io.dapr.config.Properties; 5 | import io.dapr.testcontainers.DaprContainer; 6 | 7 | public interface DaprClientFactory { 8 | 9 | static DaprClientBuilder createDaprClientBuilder(DaprContainer daprContainer) { 10 | return new DaprClientBuilder() 11 | .withPropertyOverride(Properties.HTTP_ENDPOINT, "http://localhost:" + daprContainer.getHttpPort()) 12 | .withPropertyOverride(Properties.GRPC_ENDPOINT, "http://localhost:" + daprContainer.getGrpcPort()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.java_header: -------------------------------------------------------------------------------- 1 | ^/\*$ 2 | ^ \* Copyright \d\d\d\d The Dapr Authors$ 3 | ^ \* Licensed under the Apache License, Version 2.0 \(the "License"\)\;$ 4 | ^ \* you may not use this file except in compliance with the License\.$ 5 | ^ \* You may obtain a copy of the License at$ 6 | ^ \* http://www.apache.org/licenses/LICENSE-2\.0$ 7 | ^ \* Unless required by applicable law or agreed to in writing, software$ 8 | ^ \* distributed under the License is distributed on an "AS IS" BASIS,$ 9 | ^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ 10 | ^ \* See the License for the specific language governing permissions and$ 11 | ^limitations under the License\.$ 12 | ^\*/$ -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/main/java/io/dapr/springboot/examples/producer/OrderDTO.java: -------------------------------------------------------------------------------- 1 | package io.dapr.springboot.examples.producer; 2 | 3 | public class OrderDTO { 4 | 5 | private String id; 6 | private String item; 7 | private Integer amount; 8 | 9 | public OrderDTO() { 10 | } 11 | 12 | public OrderDTO(String id, String item, Integer amount) { 13 | this.id = id; 14 | this.item = item; 15 | this.amount = amount; 16 | } 17 | 18 | public String getId() { 19 | return id; 20 | } 21 | 22 | 23 | public String getItem() { 24 | return item; 25 | } 26 | 27 | public Integer getAmount() { 28 | return amount; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-autoconfigure/src/test/java/io/dapr/spring/boot/autoconfigure/client/workflows/TestActivity.java: -------------------------------------------------------------------------------- 1 | package io.dapr.spring.boot.autoconfigure.client.workflows; 2 | 3 | import io.dapr.workflows.WorkflowActivity; 4 | import io.dapr.workflows.WorkflowActivityContext; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.client.RestTemplate; 7 | 8 | public class TestActivity implements WorkflowActivity { 9 | 10 | @Autowired 11 | private RestTemplate restTemplate; 12 | 13 | @Override 14 | public Object run(WorkflowActivityContext ctx) { 15 | return "OK"; 16 | } 17 | 18 | public RestTemplate getRestTemplate() { 19 | return restTemplate; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sdk-tests/components/http_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: github-http-binding-404 5 | spec: 6 | type: bindings.http 7 | version: v1 8 | metadata: 9 | - name: url 10 | value: https://api.github.com/unknown_path 11 | scopes: 12 | - bindingit-httpoutputbinding-exception 13 | --- 14 | apiVersion: dapr.io/v1alpha1 15 | kind: Component 16 | metadata: 17 | name: github-http-binding-404-success 18 | spec: 19 | type: bindings.http 20 | version: v1 21 | metadata: 22 | - name: url 23 | value: https://api.github.com/unknown_path 24 | - name: errorIfNot2XX 25 | value: "false" 26 | scopes: 27 | - bindingit-httpoutputbinding-ignore-error -------------------------------------------------------------------------------- /sdk-tests/components/kafka_bindings.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: dapr.io/v1alpha1 2 | kind: Component 3 | metadata: 4 | name: sample123 5 | spec: 6 | type: bindings.kafka 7 | version: v1 8 | metadata: 9 | # Kafka broker connection setting 10 | - name: brokers 11 | value: localhost:9092 12 | # consumer configuration: topic and consumer group 13 | - name: topics 14 | value: "topic-{appID}" 15 | - name: consumerGroup 16 | value: "{appID}" 17 | # publisher configuration: topic 18 | - name: publishTopic 19 | value: "topic-{appID}" 20 | - name: authRequired 21 | value: "false" 22 | - name: initialOffset 23 | value: oldest 24 | scopes: 25 | - bindingit-http-inputbindingservice 26 | - bindingit-grpc-inputbindingservice -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-autoconfigure/src/test/java/io/dapr/spring/boot/autoconfigure/client/workflows/TestWorkflow.java: -------------------------------------------------------------------------------- 1 | package io.dapr.spring.boot.autoconfigure.client.workflows; 2 | 3 | import io.dapr.workflows.Workflow; 4 | import io.dapr.workflows.WorkflowStub; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.client.RestTemplate; 7 | 8 | public class TestWorkflow implements Workflow { 9 | 10 | @Autowired 11 | private RestTemplate restTemplate; 12 | 13 | @Override 14 | public WorkflowStub create() { 15 | return ctx -> { 16 | ctx.callActivity(TestActivity.class.getName(), null).await(); 17 | }; 18 | } 19 | 20 | public RestTemplate getRestTemplate() { 21 | return restTemplate; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/FailurePolicyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | public enum FailurePolicyType { 17 | DROP, 18 | 19 | CONSTANT 20 | } 21 | -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | ossrh 11 | ${env.OSSRH_USER_TOKEN} 12 | ${env.OSSRH_PWD_TOKEN} 13 | 14 | 15 | 16 | 17 | 18 | true 19 | 20 | 21 | ${env.GPG_KEY} 22 | ${env.GPG_PWD} 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/bindings/http/docker-compose-single-kafka.yml: -------------------------------------------------------------------------------- 1 | services: 2 | zookeeper: 3 | image: confluentinc/cp-zookeeper:7.4.4 4 | environment: 5 | ZOOKEEPER_CLIENT_PORT: 2181 6 | ZOOKEEPER_TICK_TIME: 2000 7 | ports: 8 | - 22181:2181 9 | 10 | kafka: 11 | image: confluentinc/cp-kafka:7.4.4 12 | depends_on: 13 | - zookeeper 14 | ports: 15 | - 9092:9092 16 | environment: 17 | KAFKA_BROKER_ID: 1 18 | KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 19 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 20 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT 21 | KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT 22 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/DaprLogLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public enum DaprLogLevel { 17 | ERROR, 18 | WARN, 19 | INFO, 20 | DEBUG 21 | } 22 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/converter/YamlConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers.converter; 15 | 16 | public interface YamlConverter { 17 | String convert(T value); 18 | } 19 | -------------------------------------------------------------------------------- /sdk-workflows/src/main/java/io/dapr/workflows/WorkflowStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.workflows; 15 | 16 | @FunctionalInterface 17 | public interface WorkflowStub { 18 | 19 | void run(WorkflowContext ctx); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug in java-sdk 4 | title: '' 5 | labels: kind/bug 6 | assignees: '' 7 | 8 | --- 9 | ## Expected Behavior 10 | 11 | 12 | 13 | 14 | ## Actual Behavior 15 | 16 | 17 | 18 | 19 | ## Steps to Reproduce the Problem 20 | 21 | 22 | 23 | ## Release Note 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | RELEASE NOTE: -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/Stoppable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it; 15 | 16 | 17 | import java.io.IOException; 18 | 19 | public interface Stoppable { 20 | 21 | void stop() throws InterruptedException, IOException; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE generated files and directories 2 | *.iml 3 | .idea/ 4 | .run/ 5 | .vs/ 6 | .vscode/ 7 | .devcontainer/ 8 | 9 | # Output folders 10 | **/target/ 11 | 12 | # Compiled class file 13 | *.class 14 | 15 | # Proto meta 16 | *.pb.meta 17 | 18 | # Log file 19 | *.log 20 | /syslog.txt 21 | 22 | # BlueJ files 23 | *.ctxt 24 | 25 | # Mobile Tools for Java (J2ME) 26 | .mtj.tmp/ 27 | 28 | # Package Files # 29 | *.jar 30 | *.war 31 | *.nar 32 | *.ear 33 | *.zip 34 | *.tar.gz 35 | *.rar 36 | 37 | # Eclipse 38 | .classpath 39 | .project 40 | .settings 41 | 42 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 43 | hs_err_pid* 44 | 45 | # Some other generated folders/files 46 | /docs/dapr-sdk-actors 47 | /docs/dapr-sdk-autogen 48 | /docs/dapr-sdk 49 | /proto/dapr 50 | /proto/daprclient 51 | 52 | # macOS 53 | .DS_Store 54 | -------------------------------------------------------------------------------- /.github/workflows/validate-docs.yml: -------------------------------------------------------------------------------- 1 | name: Validate Javadocs Generation 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | - release-* 9 | tags: 10 | - v* 11 | 12 | pull_request: 13 | branches: 14 | - master 15 | - release-* 16 | 17 | jobs: 18 | build: 19 | name: "Validate Javadocs generation" 20 | runs-on: linux-arm64-latest-4-cores 21 | timeout-minutes: 30 22 | env: 23 | JDK_VER: 17 24 | steps: 25 | - uses: actions/checkout@v5 26 | - name: Set up OpenJDK ${{ env.JDK_VER }} 27 | uses: actions/setup-java@v5 28 | with: 29 | distribution: 'temurin' 30 | java-version: ${{ env.JDK_VER }} 31 | - name: Install jars 32 | run: ./mvnw install -q -B -DskipTests 33 | - name: Validate Java docs generation 34 | run: ./mvnw site-deploy 35 | -------------------------------------------------------------------------------- /sdk-tests/deploy/local-test.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | zookeeper: 4 | image: confluentinc/cp-zookeeper:7.4.4 5 | environment: 6 | ZOOKEEPER_CLIENT_PORT: 2181 7 | ZOOKEEPER_TICK_TIME: 2000 8 | ports: 9 | - 2181:2181 10 | 11 | kafka: 12 | image: confluentinc/cp-kafka:7.4.4 13 | depends_on: 14 | - zookeeper 15 | ports: 16 | - "9092:9092" 17 | environment: 18 | KAFKA_BROKER_ID: 1 19 | KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 20 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 21 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT 22 | KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT 23 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 24 | 25 | mongo: 26 | image: mongo 27 | ports: 28 | - "27017:27017" 29 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/FailurePolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Set a failure policy for the job. 18 | */ 19 | public interface FailurePolicy { 20 | FailurePolicyType getFailurePolicyType(); 21 | } 22 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/tracing/http/Controller.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.tracing.http; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | /** 9 | * SpringBoot Controller to handle input binding. 10 | */ 11 | @RestController 12 | public class Controller { 13 | 14 | @PostMapping(path = "/sleep") 15 | public void sleep(@RequestBody int seconds) throws InterruptedException { 16 | if (seconds < 0) { 17 | throw new IllegalArgumentException("Sleep time cannot be negative."); 18 | } 19 | Thread.sleep(seconds * 1000); 20 | } 21 | 22 | @GetMapping(path = "/health") 23 | public void health() { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/scripts/update_sdk_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -uex 4 | 5 | DAPR_JAVA_SDK_VERSION=$1 6 | 7 | # Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major. 8 | # Replaces the SDK major version to 0 for alpha artifacts. 9 | DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'` 10 | 11 | mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION -DprocessDependencies=true 12 | mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION 13 | mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION 14 | mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-tests/pom.xml 15 | mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-tests/pom.xml 16 | 17 | 18 | git clean -f 19 | -------------------------------------------------------------------------------- /sdk-actors/src/main/java/io/dapr/actors/Undefined.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors; 15 | 16 | /** 17 | * Internal class to represent the undefined value for an optional Class attribute. 18 | */ 19 | final class Undefined { 20 | 21 | private Undefined() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-data/src/main/java/io/dapr/spring/data/KeyValueAdapterResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.spring.data; 15 | 16 | import org.springframework.data.keyvalue.core.KeyValueAdapter; 17 | 18 | public interface KeyValueAdapterResolver { 19 | KeyValueAdapter resolve(); 20 | } 21 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/BulkSubscribeAppResponseStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Status of the message handled in bulk subscribe handler. 18 | */ 19 | public enum BulkSubscribeAppResponseStatus { 20 | SUCCESS, 21 | RETRY, 22 | DROP 23 | } 24 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/ConfigurationSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | // This is a marker interface, so we could get 17 | // a list of all the configuration settings implementations 18 | public interface ConfigurationSettings { 19 | } 20 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-autoconfigure/src/test/java/io/dapr/spring/boot/autoconfigure/client/WorkflowTestApplication.java: -------------------------------------------------------------------------------- 1 | package io.dapr.spring.boot.autoconfigure.client; 2 | 3 | import io.dapr.spring.workflows.config.EnableDaprWorkflows; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDaprWorkflows 12 | public class WorkflowTestApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(WorkflowTestApplication.class, args); 15 | } 16 | 17 | @Configuration 18 | static class Config { 19 | @Bean 20 | RestTemplate restTemplate(){ 21 | return new RestTemplate(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /durabletask-client/src/main/java/io/dapr/durabletask/NonDeterministicOrchestratorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.durabletask; 15 | 16 | final class NonDeterministicOrchestratorException extends RuntimeException { 17 | public NonDeterministicOrchestratorException(String message) { 18 | super(message); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | dapr-sdk-parent 1.16.0 API 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 |
19 | 22 |

index.html

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | dapr-sdk-workflows 1.16.0 API 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 |
19 | 22 |

index.html

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/actors/TestActor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.actors; 15 | import io.dapr.actors.ActorMethod; 16 | import io.dapr.actors.ActorType; 17 | 18 | @ActorType(name = "TestActor") 19 | public interface TestActor { 20 | @ActorMethod(name = "echo_message") 21 | String echo(String message); 22 | } 23 | -------------------------------------------------------------------------------- /sdk-workflows/src/main/java/io/dapr/workflows/WorkflowActivityContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.workflows; 15 | 16 | import org.slf4j.Logger; 17 | 18 | public interface WorkflowActivityContext { 19 | 20 | Logger getLogger(); 21 | 22 | String getName(); 23 | 24 | String getTaskExecutionId(); 25 | 26 | T getInput(Class targetType); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /.github/scripts/update_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -uex 4 | 5 | DAPR_JAVA_SDK_VERSION=$1 6 | 7 | # Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major. 8 | # Replaces the SDK major version to 0 for alpha artifacts. 9 | DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'` 10 | 11 | if [[ "$OSTYPE" == "darwin"* ]]; then 12 | sed -i bak "s/.*<\/version>\$/${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md 13 | sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md 14 | rm README.mdbak 15 | else 16 | sed -i "s/.*<\/version>\$/${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md 17 | sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md 18 | fi 19 | 20 | rm -rf docs 21 | ./mvnw -Dmaven.test.skip=true -Djacoco.skip=true clean install 22 | ./mvnw -Dmaven.test.skip=true -Djacoco.skip=true site-deploy 23 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/DaprProtocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public enum DaprProtocol { 17 | HTTP("http"), 18 | GRPC("grpc"); 19 | 20 | private final String name; 21 | 22 | DaprProtocol(String name) { 23 | this.name = name; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/GetSecretRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNotSame; 9 | import static org.junit.jupiter.api.Assertions.assertNull; 10 | 11 | public class GetSecretRequestTest { 12 | 13 | private String STORE_NAME = "STORE"; 14 | 15 | @Test 16 | public void testSetMetadata(){ 17 | GetSecretRequest request = new GetSecretRequest(STORE_NAME, "key"); 18 | // Null check 19 | request.setMetadata(null); 20 | assertNull(request.getMetadata()); 21 | // Modifiability check 22 | Map metadata = new HashMap<>(); 23 | metadata.put("test", "testval"); 24 | request.setMetadata(metadata); 25 | Map initial = request.getMetadata(); 26 | request.setMetadata(metadata); 27 | assertNotSame(request.getMetadata(), initial, "Should not be same map"); 28 | } 29 | } -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/GetStateRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNotSame; 9 | import static org.junit.jupiter.api.Assertions.assertNull; 10 | 11 | public class GetStateRequestTest { 12 | 13 | private String STORE_NAME = "STORE"; 14 | 15 | @Test 16 | public void testSetMetadata(){ 17 | GetStateRequest request = new GetStateRequest(STORE_NAME, "key"); 18 | // Null check 19 | request.setMetadata(null); 20 | assertNull(request.getMetadata()); 21 | // Modifiability check 22 | Map metadata = new HashMap<>(); 23 | metadata.put("test", "testval"); 24 | request.setMetadata(metadata); 25 | Map initial = request.getMetadata(); 26 | request.setMetadata(metadata); 27 | assertNotSame(request.getMetadata(), initial, "Should not be same map"); 28 | } 29 | } -------------------------------------------------------------------------------- /sdk-workflows/src/test/java/io/dapr/workflows/client/NewWorkflowOptionsTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.workflows.client; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.time.Instant; 7 | 8 | public class NewWorkflowOptionsTest { 9 | 10 | @Test 11 | void testNewWorkflowOption() { 12 | NewWorkflowOptions workflowOption = new NewWorkflowOptions(); 13 | String version = "v1"; 14 | String instanceId = "123"; 15 | Object input = new Object(); 16 | Instant startTime = Instant.now(); 17 | 18 | workflowOption.setVersion(version) 19 | .setInstanceId(instanceId) 20 | .setInput(input) 21 | .setStartTime(startTime); 22 | 23 | Assertions.assertEquals(version, workflowOption.getVersion()); 24 | Assertions.assertEquals(instanceId, workflowOption.getInstanceId()); 25 | Assertions.assertEquals(input, workflowOption.getInput()); 26 | Assertions.assertEquals(startTime, workflowOption.getStartTime()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/Metadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Enumerates commonly used metadata attributes. 18 | */ 19 | public final class Metadata { 20 | 21 | public static final String CONTENT_TYPE = "content-type"; 22 | 23 | public static final String TTL_IN_SECONDS = "ttlInSeconds"; 24 | 25 | private Metadata() { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/GetBulkSecretRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNotSame; 9 | import static org.junit.jupiter.api.Assertions.assertNull; 10 | 11 | public class GetBulkSecretRequestTest { 12 | 13 | private String STORE_NAME = "STORE"; 14 | 15 | @Test 16 | public void testSetMetadata(){ 17 | GetBulkSecretRequest request = new GetBulkSecretRequest(STORE_NAME); 18 | // Null check 19 | request.setMetadata(null); 20 | assertNull(request.getMetadata()); 21 | // Modifiability check 22 | Map metadata = new HashMap<>(); 23 | metadata.put("test", "testval"); 24 | request.setMetadata(metadata); 25 | Map initial = request.getMetadata(); 26 | request.setMetadata(metadata); 27 | assertNotSame(request.getMetadata(), initial, "Should not be same map"); 28 | } 29 | } -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/InvokeBindingRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNotSame; 9 | import static org.junit.jupiter.api.Assertions.assertNull; 10 | 11 | public class InvokeBindingRequestTest { 12 | 13 | private String BINDING_NAME = "STORE"; 14 | 15 | @Test 16 | public void testSetMetadata(){ 17 | InvokeBindingRequest request = new InvokeBindingRequest(BINDING_NAME, "operation"); 18 | // Null check 19 | request.setMetadata(null); 20 | assertNull(request.getMetadata()); 21 | // Modifiability check 22 | Map metadata = new HashMap<>(); 23 | metadata.put("test", "testval"); 24 | request.setMetadata(metadata); 25 | Map initial = request.getMetadata(); 26 | request.setMetadata(metadata); 27 | assertNotSame(request.getMetadata(), initial, "Should not be same map"); 28 | } 29 | } -------------------------------------------------------------------------------- /sdk-actors/src/test/java/io/dapr/actors/client/DaprClientStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors.client; 15 | 16 | import reactor.core.publisher.Mono; 17 | 18 | public class DaprClientStub extends ActorClient implements DaprClient { 19 | 20 | @Override 21 | public Mono invoke(String actorType, String actorId, String methodName, byte[] jsonPayload) { 22 | return Mono.just(new byte[0]); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/spring/data/TestTypeRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.spring.data; 15 | 16 | import org.springframework.data.repository.CrudRepository; 17 | import org.springframework.stereotype.Repository; 18 | 19 | import java.util.List; 20 | 21 | @Repository 22 | public interface TestTypeRepository extends CrudRepository { 23 | List findByContent(String content); 24 | } 25 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/DeleteStateRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertNull; 10 | 11 | public class DeleteStateRequestTest { 12 | 13 | private String STORE_NAME = "STORE"; 14 | private String KEY = "KEY"; 15 | 16 | @Test 17 | public void testSetMetadata(){ 18 | DeleteStateRequest request = new DeleteStateRequest(STORE_NAME, KEY); 19 | // Null check 20 | request.setMetadata(null); 21 | assertNull(request.getMetadata()); 22 | // Modifiability check 23 | Map metadata = new HashMap<>(); 24 | metadata.put("test", "testval"); 25 | request.setMetadata(metadata); 26 | Map initial = request.getMetadata(); 27 | request.setMetadata(metadata); 28 | Assertions.assertNotSame(request.getMetadata(), initial, "Should not be same map"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | target-branch: "dependabot" 8 | - package-ecosystem: "maven" 9 | directory: "/sdk" 10 | schedule: 11 | interval: "weekly" 12 | target-branch: "dependabot" 13 | - package-ecosystem: "maven" 14 | directory: "/sdk-actors" 15 | schedule: 16 | interval: "weekly" 17 | target-branch: "dependabot" 18 | - package-ecosystem: "maven" 19 | directory: "/sdk-autogen" 20 | schedule: 21 | interval: "weekly" 22 | target-branch: "dependabot" 23 | - package-ecosystem: "maven" 24 | directory: "/sdk-springboot" 25 | schedule: 26 | interval: "weekly" 27 | target-branch: "dependabot" 28 | - package-ecosystem: "maven" 29 | directory: "/sdk-tests" 30 | schedule: 31 | interval: "weekly" 32 | target-branch: "dependabot" 33 | - package-ecosystem: "github-actions" 34 | directory: "/" 35 | schedule: 36 | interval: "weekly" 37 | -------------------------------------------------------------------------------- /sdk-springboot/src/test/java/io/dapr/springboot/MockStringValueResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot; 15 | 16 | import org.springframework.util.StringValueResolver; 17 | 18 | /** 19 | * MockStringValueResolver resolves a string value to return itself. 20 | */ 21 | public class MockStringValueResolver implements StringValueResolver { 22 | @Override 23 | public String resolveStringValue(String s) { 24 | return s; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/DaprContainerConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public interface DaprContainerConstants { 17 | String DAPR_VERSION = "1.16.0-rc.5"; 18 | String DAPR_RUNTIME_IMAGE_TAG = "daprio/daprd:" + DAPR_VERSION; 19 | String DAPR_PLACEMENT_IMAGE_TAG = "daprio/placement:" + DAPR_VERSION; 20 | String DAPR_SCHEDULER_IMAGE_TAG = "daprio/scheduler:" + DAPR_VERSION; 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-examples/kubernetes/consumer-app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: consumer-app 6 | name: consumer-app 7 | spec: 8 | type: NodePort 9 | ports: 10 | - name: "consumer-app" 11 | port: 8081 12 | targetPort: 8081 13 | nodePort: 31001 14 | selector: 15 | app: consumer-app 16 | 17 | --- 18 | 19 | apiVersion: apps/v1 20 | kind: Deployment 21 | metadata: 22 | labels: 23 | app: consumer-app 24 | name: consumer-app 25 | spec: 26 | replicas: 1 27 | selector: 28 | matchLabels: 29 | app: consumer-app 30 | template: 31 | metadata: 32 | annotations: 33 | dapr.io/app-id: consumer-app 34 | dapr.io/app-port: "8081" 35 | dapr.io/enabled: "true" 36 | labels: 37 | app: consumer-app 38 | spec: 39 | containers: 40 | - image: localhost:5001/sb-consumer-app 41 | name: consumer-app 42 | imagePullPolicy: Always 43 | ports: 44 | - containerPort: 8081 45 | name: consumer-app 46 | -------------------------------------------------------------------------------- /spring-boot-examples/kubernetes/producer-app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: producer-app 6 | name: producer-app 7 | spec: 8 | type: NodePort 9 | ports: 10 | - name: "producer-app" 11 | port: 8080 12 | targetPort: 8080 13 | nodePort: 31000 14 | selector: 15 | app: producer-app 16 | 17 | --- 18 | 19 | apiVersion: apps/v1 20 | kind: Deployment 21 | metadata: 22 | labels: 23 | app: producer-app 24 | name: producer-app 25 | spec: 26 | replicas: 1 27 | selector: 28 | matchLabels: 29 | app: producer-app 30 | template: 31 | metadata: 32 | annotations: 33 | dapr.io/app-id: producer-app 34 | dapr.io/app-port: "8080" 35 | dapr.io/enabled: "true" 36 | labels: 37 | app: producer-app 38 | spec: 39 | containers: 40 | - image: localhost:5001/sb-producer-app 41 | name: producer-app 42 | imagePullPolicy: Always 43 | ports: 44 | - containerPort: 8080 45 | name: producer-app 46 | -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/main/java/io/dapr/springboot/examples/producer/OrderRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.producer; 15 | 16 | import org.springframework.data.repository.CrudRepository; 17 | 18 | import java.util.List; 19 | 20 | public interface OrderRepository extends CrudRepository { 21 | 22 | List findByItem(String item); 23 | 24 | List findByAmount(Integer amount); 25 | } 26 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/services/springboot/DemoActor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.services.springboot; 15 | 16 | import io.dapr.actors.ActorType; 17 | 18 | import java.util.List; 19 | 20 | @ActorType(name = "DemoActorTest") 21 | public interface DemoActor { 22 | String say(String something); 23 | 24 | List retrieveActiveActors(); 25 | 26 | void writeMessage(String something); 27 | 28 | String readMessage(); 29 | } 30 | -------------------------------------------------------------------------------- /docs/element-list: -------------------------------------------------------------------------------- 1 | io.dapr 2 | io.dapr.actors 3 | io.dapr.actors.client 4 | io.dapr.actors.runtime 5 | io.dapr.client 6 | io.dapr.client.domain 7 | io.dapr.client.domain.query 8 | io.dapr.client.domain.query.filters 9 | io.dapr.client.resiliency 10 | io.dapr.config 11 | io.dapr.exceptions 12 | io.dapr.internal.exceptions 13 | io.dapr.internal.grpc 14 | io.dapr.internal.grpc.interceptors 15 | io.dapr.internal.opencensus 16 | io.dapr.internal.resiliency 17 | io.dapr.serializer 18 | io.dapr.spring.boot.autoconfigure.client 19 | io.dapr.spring.boot.autoconfigure.pubsub 20 | io.dapr.spring.boot.autoconfigure.statestore 21 | io.dapr.spring.boot.testcontainers.service.connection 22 | io.dapr.spring.data 23 | io.dapr.spring.data.repository.config 24 | io.dapr.spring.data.repository.query 25 | io.dapr.spring.messaging 26 | io.dapr.spring.messaging.observation 27 | io.dapr.spring.workflows.config 28 | io.dapr.testcontainers 29 | io.dapr.testcontainers.converter 30 | io.dapr.utils 31 | io.dapr.v1 32 | io.dapr.workflows 33 | io.dapr.workflows.client 34 | io.dapr.workflows.internal 35 | io.dapr.workflows.runtime 36 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/jobs/TestJobsApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.jobs; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | @SpringBootApplication 20 | public class TestJobsApplication { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(TestJobsApplication.class, args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/TestPubSubApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | package io.dapr.it.testcontainers.pubsub.http; 14 | 15 | import org.springframework.boot.SpringApplication; 16 | import org.springframework.boot.autoconfigure.SpringBootApplication; 17 | 18 | @SpringBootApplication 19 | public class TestPubSubApplication { 20 | public static void main(String[] args) { 21 | SpringApplication.run(TestPubSubApplication.class, args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/outbox/TestPubsubOutboxApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | package io.dapr.it.testcontainers.pubsub.outbox; 14 | 15 | import org.springframework.boot.SpringApplication; 16 | import org.springframework.boot.autoconfigure.SpringBootApplication; 17 | 18 | @SpringBootApplication 19 | public class TestPubsubOutboxApplication { 20 | public static void main(String[] args) { 21 | SpringApplication.run(TestPubsubOutboxApplication.class, args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/HttpEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public class HttpEndpoint { 17 | private String name; 18 | private String baseUrl; 19 | 20 | public HttpEndpoint(String name, String baseUrl) { 21 | this.name = name; 22 | this.baseUrl = baseUrl; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public String getBaseUrl() { 30 | return baseUrl; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/workflows/TestWorkflowsApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.workflows; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | @SpringBootApplication 20 | public class TestWorkflowsApplication { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(TestWorkflowsApplication.class, args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sdk-workflows/src/main/java/io/dapr/workflows/WorkflowTaskRetryHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.workflows; 15 | 16 | public interface WorkflowTaskRetryHandler { 17 | 18 | /** 19 | * Invokes retry handler logic. Return value indicates whether to continue retrying. 20 | * 21 | * @param retryContext The context of the retry 22 | * @return {@code true} to continue retrying or {@code false} to stop retrying. 23 | */ 24 | boolean handle(WorkflowTaskRetryContext retryContext); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-examples/consumer-app/src/main/java/io/dapr/springboot/examples/consumer/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.consumer; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | @SpringBootApplication 20 | public class ConsumerApplication { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(ConsumerApplication.class, args); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sdk-actors/src/test/java/io/dapr/actors/client/ActorProxyImplForTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors.client; 15 | 16 | import io.dapr.actors.ActorId; 17 | import io.dapr.serializer.DaprObjectSerializer; 18 | 19 | public class ActorProxyImplForTests extends ActorProxyImpl { 20 | 21 | public ActorProxyImplForTests(String actorType, ActorId actorId, DaprObjectSerializer serializer, ActorClient actorClient) { 22 | super(actorType, actorId, serializer, actorClient); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/conversations/TestConversationApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.conversations; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | @SpringBootApplication 20 | public class TestConversationApplication { 21 | 22 | public static void main(String[] args) { 23 | SpringApplication.run(TestConversationApplication.class, args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/main/java/io/dapr/springboot/examples/producer/ProducerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.producer; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class ProducerApplication { 22 | 23 | public static void main(String[] args) { 24 | SpringApplication.run(ProducerApplication.class, args); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/utils/TypeRefTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.utils; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class TypeRefTest { 7 | 8 | @Test 9 | public void testTypeRefIsPrimitive() { 10 | Assertions.assertTrue(TypeRef.isPrimitive(TypeRef.BOOLEAN), "expected this to be true as boolean is primitive"); 11 | Assertions.assertTrue(TypeRef.isPrimitive(TypeRef.SHORT), "expected this to be true as short is primitive"); 12 | Assertions.assertTrue(TypeRef.isPrimitive(TypeRef.FLOAT), "expected this to be true as float is primitive"); 13 | Assertions.assertTrue(TypeRef.isPrimitive(TypeRef.DOUBLE), "expected this to be true as double is primitive"); 14 | Assertions.assertTrue(TypeRef.isPrimitive(TypeRef.INT), "expected this to be true as integer is primitive"); 15 | 16 | Assertions.assertFalse(TypeRef.isPrimitive(TypeRef.STRING), 17 | "expected this to be false as string is not primitive"); 18 | Assertions.assertFalse(TypeRef.isPrimitive(TypeRef.STRING_ARRAY), 19 | "expected this to be false as string array is not primitive"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/java/io/dapr/springboot/examples/wfp/WorkflowPatternsApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.wfp; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class WorkflowPatternsApplication { 22 | 23 | public static void main(String[] args) { 24 | SpringApplication.run(WorkflowPatternsApplication.class, args); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 20 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar 21 | -------------------------------------------------------------------------------- /docs/css/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { 21 | display: none !important; 22 | } 23 | #bodyColumn, body.docs div.docs { 24 | margin: 0 !important; 25 | border: none !important 26 | } 27 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/api/ApiIT.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.api; 2 | 3 | import io.dapr.client.DaprClient; 4 | import io.dapr.client.DaprClientBuilder; 5 | import io.dapr.it.BaseIT; 6 | import io.dapr.it.DaprRun; 7 | import org.junit.jupiter.api.Test; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | public class ApiIT extends BaseIT { 12 | 13 | private static final Logger logger = LoggerFactory.getLogger(ApiIT.class); 14 | private static final int DEFAULT_TIMEOUT = 60000; 15 | 16 | @Test 17 | public void testShutdownAPI() throws Exception { 18 | DaprRun run = startDaprApp(this.getClass().getSimpleName(), DEFAULT_TIMEOUT); 19 | 20 | // TODO(artursouza): change this to wait for the sidecar to be healthy (new method needed in DaprClient). 21 | Thread.sleep(3000); 22 | try (DaprClient client = run.newDaprClientBuilder().build()) { 23 | logger.info("Sending shutdown request."); 24 | client.shutdown().block(); 25 | 26 | logger.info("Ensuring dapr has stopped."); 27 | run.checkRunState(DEFAULT_TIMEOUT, false); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-boot-autoconfigure/src/main/java/io/dapr/spring/boot/autoconfigure/client/DaprConnectionDetails.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.spring.boot.autoconfigure.client; 15 | 16 | import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails; 17 | 18 | public interface DaprConnectionDetails extends ConnectionDetails { 19 | 20 | String getHttpEndpoint(); 21 | 22 | String getGrpcEndpoint(); 23 | 24 | Integer getHttpPort(); 25 | 26 | Integer getGrpcPort(); 27 | 28 | String getApiToken(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/DaprConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.examples; 15 | 16 | import io.dapr.client.DaprClient; 17 | import io.dapr.client.DaprClientBuilder; 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | 21 | @Configuration 22 | public class DaprConfig { 23 | 24 | private static final DaprClientBuilder BUILDER = new DaprClientBuilder(); 25 | 26 | @Bean 27 | public DaprClient buildDaprClient() { 28 | return BUILDER.build(); 29 | } 30 | } -------------------------------------------------------------------------------- /sdk-springboot/src/main/java/io/dapr/springboot/DaprAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot; 15 | 16 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 17 | import org.springframework.context.annotation.ComponentScan; 18 | import org.springframework.context.annotation.Configuration; 19 | 20 | /** 21 | * Dapr's Spring Boot AutoConfiguration. 22 | */ 23 | @Configuration 24 | @ConditionalOnWebApplication 25 | @ComponentScan("io.dapr.springboot") 26 | public class DaprAutoConfiguration { 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/java/io/dapr/springboot/examples/wfp/continueasnew/CleanUpLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.wfp.continueasnew; 15 | 16 | public class CleanUpLog { 17 | private Integer cleanUpTimes = 0; 18 | 19 | public CleanUpLog() { 20 | } 21 | 22 | public void increment() { 23 | this.cleanUpTimes += 1; 24 | } 25 | 26 | public Integer getCleanUpTimes() { 27 | return cleanUpTimes; 28 | } 29 | 30 | public void clearLog(){ 31 | this.cleanUpTimes = 0; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/java/io/dapr/springboot/examples/wfp/fanoutin/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.wfp.fanoutin; 15 | 16 | public class Result { 17 | private Integer wordCount; 18 | 19 | public Result() { 20 | } 21 | 22 | public Result(Integer wordCount) { 23 | this.wordCount = wordCount; 24 | } 25 | 26 | public Integer getWordCount() { 27 | return wordCount; 28 | } 29 | 30 | public void setWordCount(Integer wordCount) { 31 | this.wordCount = wordCount; 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /.github/workflows/dapr_bot.yml: -------------------------------------------------------------------------------- 1 | name: dapr-bot 2 | 3 | on: 4 | issue_comment: {types: created} 5 | 6 | jobs: 7 | daprbot: 8 | name: bot-processor 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Comment analyzer 12 | uses: actions/github-script@v8 13 | with: 14 | github-token: ${{secrets.DAPR_BOT_TOKEN}} 15 | script: | 16 | const payload = context.payload; 17 | const issue = context.issue; 18 | const isFromPulls = !!payload.issue.pull_request; 19 | const commentBody = payload.comment.body; 20 | 21 | if (!isFromPulls && commentBody && commentBody.indexOf("/assign") == 0) { 22 | if (!issue.assignees || issue.assignees.length === 0) { 23 | // See https://github.com/actions/github-script#breaking-changes-in-v5 24 | await github.rest.issues.addAssignees({ 25 | owner: issue.owner, 26 | repo: issue.repo, 27 | issue_number: issue.number, 28 | assignees: [context.actor], 29 | }) 30 | } 31 | return; 32 | } -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/css/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { 21 | display: none !important; 22 | } 23 | #bodyColumn, body.docs div.docs { 24 | margin: 0 !important; 25 | border: none !important 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/java/io/dapr/springboot/examples/wfp/externalevent/Decision.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.wfp.externalevent; 15 | 16 | public class Decision { 17 | private Boolean approved; 18 | 19 | public Decision() { 20 | } 21 | 22 | public Decision(Boolean approved) { 23 | this.approved = approved; 24 | } 25 | 26 | public Boolean getApproved() { 27 | return approved; 28 | } 29 | 30 | public void setApproved(Boolean approved) { 31 | this.approved = approved; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/dapr-sdk-springboot/css/print.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { 21 | display: none !important; 22 | } 23 | #bodyColumn, body.docs div.docs { 24 | margin: 0 !important; 25 | border: none !important 26 | } 27 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/DaprRunConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it; 15 | 16 | import java.lang.annotation.ElementType; 17 | import java.lang.annotation.Retention; 18 | import java.lang.annotation.RetentionPolicy; 19 | import java.lang.annotation.Target; 20 | 21 | /** 22 | * Customizes an app run for Dapr. 23 | */ 24 | @Target(ElementType.TYPE) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface DaprRunConfig { 27 | 28 | boolean enableAppHealthCheck() default false; 29 | 30 | boolean enableDaprApiToken() default true; 31 | } 32 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/services/springboot/StatefulActor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.services.springboot; 15 | 16 | public interface StatefulActor { 17 | 18 | void writeMessage(String something); 19 | 20 | String readMessage(); 21 | 22 | void writeName(String something); 23 | 24 | String readName(); 25 | 26 | void writeData(MyData something); 27 | 28 | MyData readData(); 29 | 30 | void writeBytes(byte[] something); 31 | 32 | byte[] readBytes(); 33 | 34 | class MyData { 35 | public String value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/ZipkinTracingConfigurationSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | /** 17 | * Configuration settings for Zipkin tracing. 18 | */ 19 | public class ZipkinTracingConfigurationSettings implements ConfigurationSettings { 20 | private final String endpointAddress; 21 | 22 | public ZipkinTracingConfigurationSettings(String endpointAddress) { 23 | this.endpointAddress = endpointAddress; 24 | } 25 | 26 | public String getEndpointAddress() { 27 | return endpointAddress; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-workflows/src/main/java/io/dapr/spring/workflows/config/EnableDaprWorkflows.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.spring.workflows.config; 15 | 16 | import org.springframework.context.annotation.Import; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.Target; 20 | 21 | import static java.lang.annotation.ElementType.TYPE; 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | @Retention(RUNTIME) 25 | @Target(TYPE) 26 | @Import(DaprWorkflowsConfiguration.class) 27 | public @interface EnableDaprWorkflows { 28 | } 29 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/actors/TestActorImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.actors; 15 | 16 | import io.dapr.actors.ActorId; 17 | import io.dapr.actors.runtime.AbstractActor; 18 | import io.dapr.actors.runtime.ActorRuntimeContext; 19 | 20 | public class TestActorImpl extends AbstractActor implements TestActor { 21 | public TestActorImpl(ActorRuntimeContext runtimeContext, ActorId id) { 22 | super(runtimeContext, id); 23 | } 24 | 25 | @Override 26 | public String echo(String message) { 27 | return message; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/HttpEndpointMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * HttpEndpointMetadata describes a registered Dapr HTTP endpoint. 18 | */ 19 | public final class HttpEndpointMetadata { 20 | 21 | private final String name; 22 | 23 | /** 24 | * Constructor for a HttpEndpointMetadata. 25 | * 26 | * @param name of the HTTP endpoint 27 | */ 28 | public HttpEndpointMetadata(String name) { 29 | this.name = name; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/StringProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | /** 17 | * String configuration property. 18 | */ 19 | public class StringProperty extends Property { 20 | 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | StringProperty(String name, String envName, String defaultValue) { 25 | super(name, envName, defaultValue); 26 | } 27 | 28 | /** 29 | * {@inheritDoc} 30 | */ 31 | @Override 32 | protected String parse(String value) { 33 | return value; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/domain/PublishEventRequestTest.java: -------------------------------------------------------------------------------- 1 | package io.dapr.client.domain; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | import static org.junit.jupiter.api.Assertions.assertNotSame; 10 | import static org.junit.jupiter.api.Assertions.assertNull; 11 | 12 | public class PublishEventRequestTest { 13 | 14 | private String PUBSUB_NAME = "STORE"; 15 | 16 | @Test 17 | public void testSetMetadata(){ 18 | PublishEventRequest request = new PublishEventRequest(PUBSUB_NAME, "topic", "data"); 19 | // Default empty HashMap metadata 20 | assertEquals(0, request.getMetadata().size()); 21 | // Null check 22 | request.setMetadata(null); 23 | assertNull(request.getMetadata()); 24 | // Modifiability check 25 | Map metadata = new HashMap<>(); 26 | metadata.put("test", "testval"); 27 | request.setMetadata(metadata); 28 | Map initial = request.getMetadata(); 29 | request.setMetadata(metadata); 30 | assertNotSame(request.getMetadata(), initial, "Should not be same map"); 31 | } 32 | } -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/workflows/FirstActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.workflows; 15 | 16 | import io.dapr.workflows.WorkflowActivity; 17 | import io.dapr.workflows.WorkflowActivityContext; 18 | 19 | public class FirstActivity implements WorkflowActivity { 20 | 21 | @Override 22 | public Object run(WorkflowActivityContext ctx) { 23 | TestWorkflowPayload workflowPayload = ctx.getInput(TestWorkflowPayload.class); 24 | workflowPayload.getPayloads().add("First Activity"); 25 | return workflowPayload; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/actors/runtime/DaprClientHttpUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | package io.dapr.actors.runtime; 14 | 15 | import io.grpc.ManagedChannel; 16 | 17 | /** 18 | * Exposes useful methods for IT in DaprClientHttp. 19 | */ 20 | public class DaprClientHttpUtils { 21 | 22 | public static void unregisterActorReminder( 23 | ManagedChannel channel, 24 | String actorType, 25 | String actorId, 26 | String reminderName) { 27 | new DaprClientImpl(channel).unregisterReminder(actorType, actorId, reminderName).block(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/workflows/SecondActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.workflows; 15 | 16 | import io.dapr.workflows.WorkflowActivity; 17 | import io.dapr.workflows.WorkflowActivityContext; 18 | 19 | public class SecondActivity implements WorkflowActivity { 20 | 21 | @Override 22 | public Object run(WorkflowActivityContext ctx) { 23 | TestWorkflowPayload workflowPayload = ctx.getInput(TestWorkflowPayload.class); 24 | workflowPayload.getPayloads().add("Second Activity"); 25 | return workflowPayload; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /durabletask-client/src/main/java/io/dapr/durabletask/TaskActivityFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.durabletask; 15 | 16 | /** 17 | * Factory interface for producing {@link TaskActivity} implementations. 18 | */ 19 | public interface TaskActivityFactory { 20 | /** 21 | * Gets the name of the activity this factory creates. 22 | * 23 | * @return the name of the activity 24 | */ 25 | String getName(); 26 | 27 | /** 28 | * Creates a new instance of {@link TaskActivity}. 29 | * 30 | * @return the created activity instance 31 | */ 32 | TaskActivity create(); 33 | } 34 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/BooleanProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | /** 17 | * Boolean configuration property. 18 | */ 19 | public class BooleanProperty extends Property { 20 | 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | BooleanProperty(String name, String envName, Boolean defaultValue) { 25 | super(name, envName, defaultValue); 26 | } 27 | 28 | /** 29 | * {@inheritDoc} 30 | */ 31 | @Override 32 | protected Boolean parse(String value) { 33 | return Boolean.valueOf(value); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/IntegerProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | /** 17 | * Integer configuration property. 18 | */ 19 | public class IntegerProperty extends Property { 20 | 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | IntegerProperty(String name, String envName, Integer defaultValue) { 25 | super(name, envName, defaultValue); 26 | } 27 | 28 | /** 29 | * {@inheritDoc} 30 | */ 31 | @Override 32 | protected Integer parse(String value) { 33 | return Integer.valueOf(value); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/app/MyActorStringImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.app; 15 | 16 | import io.dapr.actors.ActorId; 17 | import io.dapr.actors.ActorType; 18 | import io.dapr.actors.runtime.ActorRuntimeContext; 19 | import io.dapr.actors.runtime.Remindable; 20 | import io.dapr.utils.TypeRef; 21 | 22 | @ActorType(name = "MyActorTest") 23 | public class MyActorStringImpl extends MyActorBase implements MyActor, Remindable { 24 | 25 | public MyActorStringImpl(ActorRuntimeContext runtimeContext, ActorId id) { 26 | super(runtimeContext, id, TypeRef.STRING); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/GetJobRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Represents a request to schedule a job in Dapr. 18 | */ 19 | public class GetJobRequest { 20 | private final String name; 21 | 22 | /** 23 | * Constructor to create Get Job Request. 24 | * 25 | * @param name of the job to fetch.. 26 | */ 27 | public GetJobRequest(String name) { 28 | this.name = name; 29 | } 30 | 31 | /** 32 | * Gets the name of the job. 33 | * 34 | * @return The job name. 35 | */ 36 | public String getName() { 37 | return name; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.github/workflows/automerge-bot.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The Dapr Authors 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | name: dapr-java-sdk-automerge-bot 13 | 14 | on: 15 | schedule: 16 | - cron: '*/30 * * * *' 17 | workflow_dispatch: 18 | jobs: 19 | automerge: 20 | if: github.repository_owner == 'dapr' 21 | name: Automerge and update PRs. 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout repo 25 | uses: actions/checkout@v5 26 | - name: Install dependencies 27 | run: pip install PyGithub 28 | - name: Automerge and update 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }} 31 | run: python ./.github/scripts/automerge.py 32 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-one/src/main/java/io/dapr/springboot/examples/workerone/WorkerOneApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.workerone; 15 | 16 | import io.dapr.spring.workflows.config.EnableDaprWorkflows; 17 | import org.springframework.boot.SpringApplication; 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | 21 | @SpringBootApplication 22 | @EnableDaprWorkflows 23 | public class WorkerOneApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(WorkerOneApplication.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-two/src/main/java/io/dapr/springboot/examples/workertwo/WorkerTwoApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.workertwo; 15 | 16 | import io.dapr.spring.workflows.config.EnableDaprWorkflows; 17 | import org.springframework.boot.SpringApplication; 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | 21 | @SpringBootApplication 22 | @EnableDaprWorkflows 23 | public class WorkerTwoApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(WorkerTwoApplication.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/workflows/utils/PropertyUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.examples.workflows.utils; 15 | 16 | import io.dapr.config.Properties; 17 | 18 | import java.util.HashMap; 19 | 20 | public class PropertyUtils { 21 | 22 | public static Properties getProperties(String[] args) { 23 | Properties properties = new Properties(); 24 | if (args != null && args.length > 0) { 25 | properties = new Properties(new HashMap<>() {{ 26 | put(Properties.GRPC_PORT, args[0]); 27 | }}); 28 | } 29 | 30 | return properties; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk-actors/src/main/java/io/dapr/actors/runtime/ActorCallType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors.runtime; 15 | 16 | /** 17 | * Represents the call-type associated with the method invoked by actor runtime. 18 | */ 19 | enum ActorCallType { 20 | 21 | /** 22 | * Specifies that the method invoked is an actor interface method for a given 23 | * client request. 24 | */ 25 | ACTOR_INTERFACE_METHOD, 26 | /** 27 | * Specifies that the method invoked is a timer callback method. 28 | */ 29 | TIMER_METHOD, 30 | /** 31 | * Specifies that the method is when a reminder fires. 32 | */ 33 | REMINDER_METHOD 34 | } 35 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/app/MyActorBinaryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.app; 15 | 16 | import io.dapr.actors.ActorId; 17 | import io.dapr.actors.ActorType; 18 | import io.dapr.actors.runtime.ActorRuntimeContext; 19 | import io.dapr.actors.runtime.Remindable; 20 | import io.dapr.utils.TypeRef; 21 | 22 | @ActorType(name = "MyActorBinaryTest") 23 | public class MyActorBinaryImpl extends MyActorBase implements MyActor, Remindable { 24 | 25 | public MyActorBinaryImpl(ActorRuntimeContext runtimeContext, ActorId id) { 26 | super(runtimeContext, id, TypeRef.BYTE_ARRAY); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/query/Pagination.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain.query; 15 | 16 | import com.fasterxml.jackson.annotation.JsonInclude; 17 | 18 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 19 | public class Pagination { 20 | private int limit; 21 | private String token; 22 | 23 | Pagination() { 24 | // For JSON 25 | } 26 | 27 | public Pagination(int limit, String token) { 28 | this.limit = limit; 29 | this.token = token; 30 | } 31 | 32 | public int getLimit() { 33 | return limit; 34 | } 35 | 36 | public String getToken() { 37 | return token; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/ListEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public class ListEntry { 17 | private String name; 18 | private String type; 19 | 20 | public ListEntry(String name, String type) { 21 | this.name = name; 22 | this.type = type; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public String getType() { 30 | return type; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public void setType(String type) { 38 | this.type = type; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestrationFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.durabletask; 15 | 16 | /** 17 | * Factory interface for producing {@link TaskOrchestration} implementations. 18 | */ 19 | public interface TaskOrchestrationFactory { 20 | /** 21 | * Gets the name of the orchestration this factory creates. 22 | * 23 | * @return the name of the orchestration 24 | */ 25 | String getName(); 26 | 27 | /** 28 | * Creates a new instance of {@link TaskOrchestration}. 29 | * 30 | * @return the created orchestration instance 31 | */ 32 | TaskOrchestration create(); 33 | } 34 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/DeleteJobRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Represents a request to schedule a job in Dapr. 18 | */ 19 | public class DeleteJobRequest { 20 | private final String name; 21 | 22 | /** 23 | * Constructor to create Delete Job Request. 24 | * 25 | * @param name of the job to delete. 26 | */ 27 | public DeleteJobRequest(String name) { 28 | this.name = name; 29 | } 30 | 31 | /** 32 | * Gets the name of the job. 33 | * 34 | * @return The job name. 35 | */ 36 | public String getName() { 37 | return name; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/DropFailurePolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * A failure policy that drops the job upon failure without retrying. 18 | * This implementation of {@link FailurePolicy} immediately discards failed jobs 19 | * instead of retrying them. 20 | */ 21 | public class DropFailurePolicy implements FailurePolicy { 22 | 23 | /** 24 | * Returns the type of failure policy. 25 | * 26 | * @return {@link FailurePolicyType#DROP} 27 | */ 28 | @Override 29 | public FailurePolicyType getFailurePolicyType() { 30 | return FailurePolicyType.DROP; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/orchestrator/src/main/java/io/dapr/springboot/examples/orchestrator/OrchestratorApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.orchestrator; 15 | 16 | import io.dapr.spring.workflows.config.EnableDaprWorkflows; 17 | import org.springframework.boot.SpringApplication; 18 | import org.springframework.boot.autoconfigure.SpringBootApplication; 19 | 20 | 21 | @SpringBootApplication 22 | @EnableDaprWorkflows 23 | public class OrchestratorApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(OrchestratorApplication.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /docs/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.7.1 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.7.1 6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | ``` 27 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/app/MyActorObjectImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.app; 15 | 16 | import io.dapr.actors.ActorId; 17 | import io.dapr.actors.ActorType; 18 | import io.dapr.actors.runtime.ActorRuntimeContext; 19 | import io.dapr.actors.runtime.Remindable; 20 | import io.dapr.utils.TypeRef; 21 | 22 | @ActorType(name = "MyActorObjectTest") 23 | public class MyActorObjectImpl extends MyActorBase implements MyActor, Remindable { 24 | 25 | public MyActorObjectImpl(ActorRuntimeContext runtimeContext, ActorId id) { 26 | super(runtimeContext, id, TypeRef.get(MyObject.class)); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/MetadataEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | public class MetadataEntry { 17 | private String name; 18 | private String value; 19 | 20 | public MetadataEntry(String name, String value) { 21 | this.name = name; 22 | this.value = value; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public String getValue() { 30 | return value; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public void setValue(String value) { 38 | this.value = value; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/app/TestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.app; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | /** 20 | * Dapr's HTTP callback implementation via SpringBoot. 21 | */ 22 | @SpringBootApplication 23 | public class TestApplication { 24 | /** 25 | * Starts Dapr's callback in a given port. 26 | * @param port Port to listen to. 27 | */ 28 | public static void start(long port) { 29 | SpringApplication.run(TestApplication.class, String.format("--server.port=%d", port)); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sdk-actors/src/main/java/io/dapr/actors/ActorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors; 15 | 16 | import java.lang.annotation.Documented; 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | /** 23 | * Annotation to define Actor class. 24 | */ 25 | @Documented 26 | @Target({ElementType.TYPE_USE, ElementType.TYPE}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface ActorType { 29 | 30 | /** 31 | * Overrides Actor's name. 32 | * 33 | * @return Actor's name. 34 | */ 35 | String name(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /docs/dapr-sdk-workflows/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.7.1 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.7.1 6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | ``` 27 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/Headers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client; 15 | 16 | /** 17 | * Common headers for GRPC and HTTP communication. 18 | */ 19 | public final class Headers { 20 | 21 | /** 22 | * OpenCensus's metadata for GRPC. 23 | */ 24 | public static final String GRPC_TRACE_BIN = "grpc-trace-bin"; 25 | 26 | /** 27 | * Token for authentication from Application to Dapr runtime. 28 | */ 29 | public static final String DAPR_API_TOKEN = "dapr-api-token"; 30 | 31 | /** 32 | * Header for Api Logging User-Agent. 33 | */ 34 | public static final String DAPR_USER_AGENT = "User-Agent"; 35 | } 36 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/runtime/MethodListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.runtime; 15 | 16 | import reactor.core.publisher.Mono; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * Processes a given API's method call. 22 | */ 23 | public interface MethodListener { 24 | 25 | /** 26 | * Processes a given API's method call. 27 | * @param data Raw input payload. 28 | * @param metadata Header (or metadata). 29 | * @return Raw response or empty. 30 | * @throws Exception Any exception from user code. 31 | */ 32 | Mono process(byte[] data, Map metadata) throws Exception; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/ConversationMessageContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Represents the content of a conversation message. 18 | */ 19 | public class ConversationMessageContent { 20 | 21 | private final String text; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param text the text content of the message 27 | */ 28 | public ConversationMessageContent(String text) { 29 | this.text = text; 30 | } 31 | 32 | /** 33 | * Gets the text content of the message. 34 | * 35 | * @return the text content 36 | */ 37 | public String getText() { 38 | return text; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-boot-examples/consumer-app/src/test/java/io/dapr/springboot/examples/consumer/TestConsumerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.consumer; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestConsumerApplication { 22 | 23 | public static void main(String[] args) { 24 | SpringApplication.from(ConsumerApplication::main) 25 | .with(DaprTestContainersConfig.class) 26 | .run(args); 27 | org.testcontainers.Testcontainers.exposeHostPorts(8081); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/test/java/io/dapr/springboot/examples/producer/TestProducerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.producer; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestProducerApplication { 22 | 23 | public static void main(String[] args) { 24 | 25 | SpringApplication.from(ProducerApplication::main) 26 | .with(DaprTestContainersConfig.class) 27 | .run(args); 28 | org.testcontainers.Testcontainers.exposeHostPorts(8080); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/main/java/io/dapr/springboot/examples/wfp/timer/TimerLogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | package io.dapr.springboot.examples.wfp.timer; 14 | 15 | import org.springframework.stereotype.Component; 16 | 17 | import java.util.ArrayList; 18 | import java.util.Date; 19 | import java.util.List; 20 | 21 | @Component 22 | public class TimerLogService { 23 | private final List logDates = new ArrayList<>(); 24 | 25 | public void logDate(Date date){ 26 | logDates.add(date); 27 | } 28 | 29 | public void clearLog(){ 30 | logDates.clear(); 31 | } 32 | 33 | public List getLogDates(){ 34 | return logDates; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /durabletask-client/src/main/java/io/dapr/durabletask/TaskCanceledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.durabletask; 15 | 16 | //@TODO: This should inherit from Exception, not TaskFailedException 17 | 18 | /** 19 | * Represents a task cancellation, either because of a timeout or because of an explicit cancellation operation. 20 | */ 21 | public final class TaskCanceledException extends TaskFailedException { 22 | // Only intended to be created within this package 23 | TaskCanceledException(String message, String taskName, int taskId) { 24 | super(message, taskName, taskId, new FailureDetails(TaskCanceledException.class.getName(), message, "", true)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/jobs/DemoJobsSpringApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.examples.jobs; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | /** 20 | * Spring Boot application to demonstrate Dapr Jobs callback API. 21 | *

22 | * This application demonstrates how to use Dapr Jobs API with Spring Boot. 23 | *

24 | */ 25 | @SpringBootApplication 26 | public class DemoJobsSpringApplication { 27 | 28 | public static void main(String[] args) throws Exception { 29 | SpringApplication.run(DemoJobsSpringApplication.class, args); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-data/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | io.dapr.spring 8 | dapr-spring-parent 9 | 1.17.0-SNAPSHOT 10 | ../pom.xml 11 | 12 | 13 | dapr-spring-data 14 | dapr-spring-data 15 | Dapr Spring Data 16 | jar 17 | 18 | 19 | 20 | org.springframework.data 21 | spring-data-keyvalue 22 | 23 | 24 | io.dapr 25 | dapr-sdk 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.sonatype.plugins 33 | nexus-staging-maven-plugin 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"io.dapr"},{"l":"io.dapr.actors"},{"l":"io.dapr.actors.client"},{"l":"io.dapr.actors.runtime"},{"l":"io.dapr.client"},{"l":"io.dapr.client.domain"},{"l":"io.dapr.client.domain.query"},{"l":"io.dapr.client.domain.query.filters"},{"l":"io.dapr.client.resiliency"},{"l":"io.dapr.config"},{"l":"io.dapr.exceptions"},{"l":"io.dapr.internal.exceptions"},{"l":"io.dapr.internal.grpc"},{"l":"io.dapr.internal.grpc.interceptors"},{"l":"io.dapr.internal.opencensus"},{"l":"io.dapr.internal.resiliency"},{"l":"io.dapr.serializer"},{"l":"io.dapr.spring.boot.autoconfigure.client"},{"l":"io.dapr.spring.boot.autoconfigure.pubsub"},{"l":"io.dapr.spring.boot.autoconfigure.statestore"},{"l":"io.dapr.spring.boot.testcontainers.service.connection"},{"l":"io.dapr.spring.data"},{"l":"io.dapr.spring.data.repository.config"},{"l":"io.dapr.spring.data.repository.query"},{"l":"io.dapr.spring.messaging"},{"l":"io.dapr.spring.messaging.observation"},{"l":"io.dapr.spring.workflows.config"},{"l":"io.dapr.testcontainers"},{"l":"io.dapr.testcontainers.converter"},{"l":"io.dapr.utils"},{"l":"io.dapr.v1"},{"l":"io.dapr.workflows"},{"l":"io.dapr.workflows.client"},{"l":"io.dapr.workflows.internal"},{"l":"io.dapr.workflows.runtime"}];updateSearchResults(); -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/methodinvoke/http/Person.java: -------------------------------------------------------------------------------- 1 | package io.dapr.it.methodinvoke.http; 2 | 3 | import java.util.Date; 4 | 5 | public class Person { 6 | 7 | private int id; 8 | private String name; 9 | private String lastName; 10 | private Date birthDate; 11 | 12 | @Override 13 | public String toString() { 14 | return "Person{" + 15 | "id=" + id + 16 | ", name='" + name + '\'' + 17 | ", lastName='" + lastName + '\'' + 18 | ", birthDate=" + birthDate + 19 | '}'; 20 | } 21 | 22 | public int getId() { 23 | return id; 24 | } 25 | 26 | public void setId(int id) { 27 | this.id = id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public String getLastName() { 39 | return lastName; 40 | } 41 | 42 | public void setLastName(String lastName) { 43 | this.lastName = lastName; 44 | } 45 | 46 | public Date getBirthDate() { 47 | return birthDate; 48 | } 49 | 50 | public void setBirthDate(Date birthDate) { 51 | this.birthDate = birthDate; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /dapr-spring/dapr-spring-messaging/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | io.dapr.spring 8 | dapr-spring-parent 9 | 1.17.0-SNAPSHOT 10 | ../pom.xml 11 | 12 | 13 | dapr-spring-messaging 14 | dapr-spring-messaging 15 | Dapr Spring Messaging 16 | jar 17 | 18 | 19 | 20 | org.springframework 21 | spring-context 22 | 23 | 24 | io.dapr 25 | dapr-sdk 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.sonatype.plugins 33 | nexus-staging-maven-plugin 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/client/DaprClientTestBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client; 15 | 16 | import io.dapr.serializer.DefaultObjectSerializer; 17 | 18 | /** 19 | * Builder for DaprClient used in tests only. 20 | */ 21 | public class DaprClientTestBuilder { 22 | 23 | /** 24 | * Builds a DaprClient only for HTTP calls. 25 | * @param client DaprHttp used for http calls (can be mocked or stubbed) 26 | * @return New instance of DaprClient. 27 | */ 28 | public static DaprClient buildClientForHttpOnly(DaprHttp client) { 29 | return new DaprClientImpl(null, null, client, new DefaultObjectSerializer(), new DefaultObjectSerializer()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-one/src/test/java/io/dapr/springboot/examples/workerone/TestWorkerOneApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.workerone; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestWorkerOneApplication { 22 | 23 | public static void main(String[] args) { 24 | 25 | SpringApplication.from(WorkerOneApplication::main) 26 | .with(DaprTestContainersConfig.class) 27 | .run(args); 28 | org.testcontainers.Testcontainers.exposeHostPorts(8081); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/worker-two/src/test/java/io/dapr/springboot/examples/workertwo/TestWorkerTwoApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.workertwo; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestWorkerTwoApplication { 22 | 23 | public static void main(String[] args) { 24 | 25 | SpringApplication.from(WorkerTwoApplication::main) 26 | .with(DaprTestContainersConfig.class) 27 | .run(args); 28 | org.testcontainers.Testcontainers.exposeHostPorts(8082); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/patterns/src/test/java/io/dapr/springboot/examples/wfp/TestWorkflowPatternsApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.wfp; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestWorkflowPatternsApplication { 22 | 23 | public static void main(String[] args) { 24 | 25 | SpringApplication.from(WorkflowPatternsApplication::main) 26 | .with(DaprTestContainersConfig.class) 27 | .run(args); 28 | org.testcontainers.Testcontainers.exposeHostPorts(8080); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /sdk-actors/src/main/java/io/dapr/actors/runtime/ActorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors.runtime; 15 | 16 | import io.dapr.actors.ActorId; 17 | 18 | /** 19 | * Creates an actor of a given type. 20 | * 21 | * @param Actor Type to be created. 22 | */ 23 | @FunctionalInterface 24 | public interface ActorFactory { 25 | 26 | /** 27 | * Creates an Actor. 28 | * 29 | * @param actorRuntimeContext Actor type's context in the runtime. 30 | * @param actorId Actor Id. 31 | * @return Actor or null it failed. 32 | */ 33 | T createActor(ActorRuntimeContext actorRuntimeContext, ActorId actorId); 34 | } 35 | -------------------------------------------------------------------------------- /spring-boot-examples/workflows/multi-app/orchestrator/src/test/java/io/dapr/springboot/examples/orchestrator/TestOrchestratorApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.orchestrator; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | 20 | @SpringBootApplication 21 | public class TestOrchestratorApplication { 22 | 23 | public static void main(String[] args) { 24 | 25 | SpringApplication.from(OrchestratorApplication::main) 26 | .with(DaprTestContainersConfig.class) 27 | .run(args); 28 | org.testcontainers.Testcontainers.exposeHostPorts(8080); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/app/MyObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.app; 15 | 16 | /** 17 | * This class is for passing string or binary data to the Actor for registering reminder later on during test. 18 | */ 19 | public class MyObject { 20 | 21 | private String name; 22 | 23 | private int age; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | 33 | public int getAge() { 34 | return age; 35 | } 36 | 37 | public void setAge(int age) { 38 | this.age = age; 39 | } 40 | 41 | public String toString() { 42 | return this.name + "," + this.age; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/ActorMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * ActorMetadata describes a registered Dapr Actor. 18 | */ 19 | public final class ActorMetadata { 20 | private final String type; 21 | private final int count; 22 | 23 | /** 24 | * Constructor for a ActorMetadata. 25 | * 26 | * @param type of the actor 27 | * @param count number of actors of a particular type 28 | */ 29 | public ActorMetadata(String type, int count) { 30 | this.type = type; 31 | this.count = count; 32 | } 33 | 34 | public String getType() { 35 | return type; 36 | } 37 | 38 | public int getCount() { 39 | return count; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /testcontainers-dapr/src/main/java/io/dapr/testcontainers/AppHttpPipeline.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.testcontainers; 15 | 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | public class AppHttpPipeline implements ConfigurationSettings { 20 | private List handlers; 21 | 22 | /** 23 | * Creates an AppHttpPipeline. 24 | * 25 | * @param handlers List of handlers for the AppHttpPipeline 26 | */ 27 | public AppHttpPipeline(List handlers) { 28 | if (handlers != null) { 29 | this.handlers = Collections.unmodifiableList(handlers); 30 | } 31 | } 32 | 33 | public List getHandlers() { 34 | return handlers; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /sdk-springboot/src/main/java/io/dapr/springboot/DaprTopicRoutes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | import java.util.List; 19 | import java.util.Optional; 20 | 21 | class DaprTopicRoutes { 22 | private final List rules; 23 | @JsonProperty("default") 24 | private final String defaultRoute; 25 | 26 | DaprTopicRoutes(List rules, String defaultRoute) { 27 | this.rules = rules; 28 | this.defaultRoute = defaultRoute; 29 | } 30 | 31 | public List getRules() { 32 | return rules; 33 | } 34 | 35 | public String getDefaultRoute() { 36 | return defaultRoute; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/SecondsDurationProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | import java.time.Duration; 17 | 18 | /** 19 | * Integer configuration property. 20 | */ 21 | public class SecondsDurationProperty extends Property { 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | SecondsDurationProperty(String name, String envName, Duration defaultValue) { 27 | super(name, envName, defaultValue); 28 | } 29 | 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | @Override 34 | protected Duration parse(String value) { 35 | long longValue = Long.parseLong(value); 36 | return Duration.ofSeconds(longValue); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/actors/DemoActor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.examples.actors; 15 | 16 | import io.dapr.actors.ActorMethod; 17 | import io.dapr.actors.ActorType; 18 | import reactor.core.publisher.Mono; 19 | 20 | /** 21 | * Example of implementation of an Actor. 22 | */ 23 | @ActorType(name = "DemoActor") 24 | public interface DemoActor { 25 | 26 | void registerTimer(String state); 27 | 28 | void registerReminder(int index); 29 | 30 | @ActorMethod(name = "echo_message") 31 | String say(String something); 32 | 33 | void clock(String message); 34 | 35 | @ActorMethod(returns = Integer.class) 36 | Mono incrementAndGet(int delta); 37 | } 38 | -------------------------------------------------------------------------------- /sdk-workflows/src/main/java/io/dapr/workflows/Workflow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.workflows; 15 | 16 | /** 17 | * Common interface for workflow implementations. 18 | */ 19 | public interface Workflow { 20 | /** 21 | * Executes the workflow logic. 22 | * 23 | * @return A WorkflowStub. 24 | */ 25 | WorkflowStub create(); 26 | 27 | /** 28 | * Executes the workflow logic. 29 | * 30 | * @param ctx provides access to methods for scheduling durable tasks and 31 | * getting information about the current 32 | * workflow instance. 33 | */ 34 | default void run(WorkflowContext ctx) { 35 | WorkflowStub stub = this.create(); 36 | 37 | stub.run(ctx); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/serializer/CustomizableObjectSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.serializer; 15 | 16 | import com.fasterxml.jackson.databind.ObjectMapper; 17 | import io.dapr.client.ObjectSerializer; 18 | 19 | public class CustomizableObjectSerializer extends ObjectSerializer implements DaprObjectSerializer { 20 | 21 | private final ObjectMapper objectMapper; 22 | 23 | public CustomizableObjectSerializer(ObjectMapper objectMapper) { 24 | this.objectMapper = objectMapper; 25 | } 26 | 27 | @Override 28 | public ObjectMapper getObjectMapper() { 29 | return objectMapper; 30 | } 31 | 32 | @Override 33 | public String getContentType() { 34 | return "application/json"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/ConversationTools.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * Represents tool definitions that can be used during conversation. 18 | */ 19 | public class ConversationTools { 20 | 21 | private final ConversationToolsFunction function; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param function the function definition 27 | */ 28 | public ConversationTools(ConversationToolsFunction function) { 29 | this.function = function; 30 | } 31 | 32 | /** 33 | * Gets the function definition. 34 | * 35 | * @return the function definition 36 | */ 37 | public ConversationToolsFunction getFunction() { 38 | return function; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/MillisecondsDurationProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | import java.time.Duration; 17 | 18 | /** 19 | * Integer configuration property. 20 | */ 21 | public class MillisecondsDurationProperty extends Property { 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | MillisecondsDurationProperty(String name, String envName, Duration defaultValue) { 27 | super(name, envName, defaultValue); 28 | } 29 | 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | @Override 34 | protected Duration parse(String value) { 35 | long longValue = Long.parseLong(value); 36 | return Duration.ofMillis(longValue); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /sdk/src/test/java/io/dapr/runtime/TopicListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.runtime; 15 | 16 | import io.dapr.client.domain.CloudEvent; 17 | import reactor.core.publisher.Mono; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * Processes a given topic's message delivery. 23 | */ 24 | public interface TopicListener { 25 | 26 | /** 27 | * Processes a given topic's message delivery. 28 | * @param message Message event to be processed. 29 | * @param metadata Headers (or metadata). 30 | * @return Empty response. 31 | * @throws Exception Any exception from user code. 32 | */ 33 | Mono process(CloudEvent message, Map metadata) throws Exception; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/actors/services/springboot/DaprApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.actors.services.springboot; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | 19 | /** 20 | * Dapr's HTTP callback implementation via SpringBoot. 21 | */ 22 | @SpringBootApplication 23 | public class DaprApplication { 24 | 25 | /** 26 | * Starts Dapr's callback in a given port. 27 | * 28 | * @param port Port to listen to. 29 | */ 30 | public static void start(long port) { 31 | SpringApplication app = new SpringApplication(DaprApplication.class); 32 | app.run(String.format("--server.port=%d", port)); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sdk-actors/src/main/java/io/dapr/actors/client/DaprClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.actors.client; 15 | 16 | import reactor.core.publisher.Mono; 17 | 18 | /** 19 | * Generic Client Adapter to be used regardless of the GRPC or the HTTP Client implementation required. 20 | */ 21 | interface DaprClient { 22 | 23 | /** 24 | * Invokes an Actor method on Dapr. 25 | * 26 | * @param actorType Type of actor. 27 | * @param actorId Actor Identifier. 28 | * @param methodName Method name to invoke. 29 | * @param jsonPayload Serialized body. 30 | * @return Asynchronous result with the Actor's response. 31 | */ 32 | Mono invoke(String actorType, String actorId, String methodName, byte[] jsonPayload); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/domain/RuleMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.domain; 15 | 16 | /** 17 | * RuleMetadata describes the Subscription Rule's Metadata. 18 | */ 19 | public final class RuleMetadata { 20 | 21 | private final String match; 22 | private final String path; 23 | 24 | /** 25 | * Constructor for a RuleMetadata. 26 | * 27 | * @param match CEL expression to match the message 28 | * @param path path to route the message 29 | */ 30 | public RuleMetadata(String match, String path) { 31 | this.match = match; 32 | this.path = path; 33 | } 34 | 35 | public String getMatch() { 36 | return match; 37 | } 38 | 39 | public String getPath() { 40 | return path; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/config/GenericProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.config; 15 | 16 | import java.util.function.Function; 17 | 18 | /** 19 | * Configuration property for any type. 20 | */ 21 | public class GenericProperty extends Property { 22 | 23 | private final Function parser; 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | GenericProperty(String name, String envName, T defaultValue, Function parser) { 29 | super(name, envName, defaultValue); 30 | this.parser = parser; 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | @Override 37 | protected T parse(String value) { 38 | return parser.apply(value); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /examples/src/main/java/io/dapr/examples/OpenTelemetryInterceptorConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.examples; 15 | 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Component; 18 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 19 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 20 | 21 | @Component 22 | public class OpenTelemetryInterceptorConfig extends WebMvcConfigurationSupport { 23 | 24 | @Autowired 25 | OpenTelemetryInterceptor interceptor; 26 | 27 | @Override 28 | public void addInterceptors(InterceptorRegistry registry) { 29 | registry.addInterceptor(interceptor); 30 | } 31 | } -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/Retry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it; 15 | 16 | public class Retry { 17 | 18 | private Retry() {} 19 | 20 | public static void callWithRetry(Runnable function, long retryTimeoutMilliseconds) throws InterruptedException { 21 | long started = System.currentTimeMillis(); 22 | while (true) { 23 | Throwable exception; 24 | try { 25 | function.run(); 26 | return; 27 | } catch (Exception e) { 28 | exception = e; 29 | } catch (AssertionError e) { 30 | exception = e; 31 | } 32 | 33 | if (System.currentTimeMillis() - started >= retryTimeoutMilliseconds) { 34 | throw new RuntimeException(exception); 35 | } 36 | Thread.sleep(1000); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptorConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.tracing.http; 15 | 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Component; 18 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 19 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 20 | 21 | @Component 22 | public class OpenTelemetryInterceptorConfig extends WebMvcConfigurationSupport { 23 | 24 | @Autowired 25 | OpenTelemetryInterceptor interceptor; 26 | 27 | @Override 28 | public void addInterceptors(InterceptorRegistry registry) { 29 | registry.addInterceptor(interceptor); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sdk/src/main/java/io/dapr/client/resiliency/ResiliencyOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.client.resiliency; 15 | 16 | import java.time.Duration; 17 | 18 | /** 19 | * Resiliency policy for SDK communication to Dapr API. 20 | */ 21 | public final class ResiliencyOptions { 22 | 23 | private Duration timeout; 24 | 25 | private Integer maxRetries; 26 | 27 | public Duration getTimeout() { 28 | return timeout; 29 | } 30 | 31 | public ResiliencyOptions setTimeout(Duration timeout) { 32 | this.timeout = timeout; 33 | return this; 34 | } 35 | 36 | public Integer getMaxRetries() { 37 | return maxRetries; 38 | } 39 | 40 | public ResiliencyOptions setMaxRetries(Integer maxRetries) { 41 | this.maxRetries = maxRetries; 42 | return this; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-boot-examples/producer-app/src/main/java/io/dapr/springboot/examples/producer/CustomerStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.springboot.examples.producer; 15 | 16 | import org.springframework.stereotype.Component; 17 | 18 | import java.util.Collection; 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | 22 | @Component 23 | public class CustomerStore { 24 | private Map customers = new HashMap<>(); 25 | 26 | public void addCustomer(Customer customer) { 27 | customers.put(customer.getCustomerName(), customer); 28 | } 29 | 30 | public Customer getCustomer(String customerName) { 31 | return customers.get(customerName); 32 | } 33 | 34 | public Collection getCustomers() { 35 | return customers.values(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sdk-tests/src/test/java/io/dapr/it/testcontainers/actors/TestActorsApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 The Dapr Authors 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | package io.dapr.it.testcontainers.actors; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | import org.springframework.web.bind.annotation.GetMapping; 19 | import org.springframework.web.bind.annotation.RestController; 20 | 21 | @SpringBootApplication 22 | @RestController 23 | public class TestActorsApplication { 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(TestActorsApplication.class, args); 27 | } 28 | 29 | //Mocking the actuator health endpoint for the sidecar health check 30 | @GetMapping("/actuator/health") 31 | public String health(){ 32 | return "OK"; 33 | } 34 | } 35 | --------------------------------------------------------------------------------