{"id":13704947,"url":"https://github.com/cadence-workflow/cadence-java-samples","last_synced_at":"2025-12-29T23:39:18.679Z","repository":{"id":33838363,"uuid":"141474940","full_name":"uber/cadence-java-samples","owner":"uber","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-22T00:17:00.000Z","size":754,"stargazers_count":94,"open_issues_count":15,"forks_count":58,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-22T15:33:42.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-18T18:32:38.000Z","updated_at":"2024-08-02T23:22:49.339Z","dependencies_parsed_at":"2024-01-16T22:38:34.304Z","dependency_job_id":"2ba61a2b-41ba-43c9-b773-6efa53ac6554","html_url":"https://github.com/uber/cadence-java-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fcadence-java-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fcadence-java-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fcadence-java-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uber%2Fcadence-java-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uber","download_url":"https://codeload.github.com/uber/cadence-java-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224448813,"owners_count":17313119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T22:00:27.538Z","updated_at":"2025-12-29T23:39:18.649Z","avatar_url":"https://github.com/uber.png","language":"Java","readme":"# Java Cadence Samples\nThese samples demonstrate various capabilities of Java Cadence client and server. You can learn more about Cadence at:\n* [Cadence Service](https://github.com/uber/cadence)\n* [Cadence Java Client](https://github.com/uber/cadence-java-client)\n* [Go Cadence Client](https://github.com/uber-go/cadence-client)\n\n## Overview of the Samples\n\n* **HelloWorld Samples**\n\n    The following samples demonstrate:\n\n  * **HelloActivity**: a single activity workflow\n  * **HelloActivityRetry**: how to retry an activity\n  * **HelloAsync**: how to call activities asynchronously and wait for them using Promises\n  * **HelloAsyncLambda**: how to run part of a workflow asynchronously in a separate task (thread)\n  * **HelloAsyncActivityCompletion**: an asynchronous activity implementation\n  * **HelloChild**: a child workflow\n  * **HelloException**: exception propagation and wrapping\n  * **HelloQuery**: a query\n  * **HelloSignal**: sending and handling a signal\n  * **HelloPeriodic**: a sample workflow that executes an activity periodically forever\n  * **HelloSearchAttributes**: how to use search attributes\n  * **HelloCron**: a cron workflow \n\n* **FileProcessing** demonstrates task routing features. The sample workflow downloads a file, processes it, and uploads\n    the result to a destination. The first activity can be picked up by any worker. However, the second and third activities\n    must be executed on the same host as the first one.\n\n## Get the Samples\n\nRun the following commands:\n\n      git clone https://github.com/uber/cadence-java-samples\n      cd cadence-java-samples\n\n## Import into IntelliJ\n\nIn the IntelliJ user interface, navigate to **File**-\u003e**New**-\u003e**Project from Existing Sources**.\n\nSelect the cloned directory. In the **Import Project page**, select **Import project from external model**,\nchoose **Gradle** and then click **Next**-\u003e**Finish**.\n\n## Build the Samples\n\n      ./gradlew build\n\n## Run Cadence Server\n\nRun Cadence Server using Docker Compose:\n\n    curl -O https://raw.githubusercontent.com/uber/cadence/master/docker/docker-compose.yml\n    docker-compose up\n\nIf this does not work, see the instructions for running Cadence Server\nat https://github.com/uber/cadence/blob/master/README.md.\n\n## Register the Domain\n\nTo register the *samples-domain* domain, run the following command once before running any samples:\n\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain\n\nOr using Cadence CLI:\n\n```\ncadence --domain samples-domain domain register\n```\n\n## See Cadence UI\n\nThe Cadence Server running in a docker container includes a Web UI.\n\nConnect to [http://localhost:8088](http://localhost:8088).\n\nEnter the *samples-domain* domain. You'll see a \"No Results\" page. After running any sample, change the filter in the\ntop right corner from \"Open\" to \"Closed\" to see the list of the completed workflows.\n\nClick on a *RUN ID* of a workflow to see more details about it. Try different view formats to get a different level of\ndetails about the execution history.\n\n## Install Cadence CLI\n\n[Command Line Interface Documentation](https://mfateev.github.io/cadence/docs/08_cli)\n\n## Run the samples\n\nEach sample has specific requirements for running it. The following sections contain information about\nhow to run each of the samples after you've built them using the preceding instructions.\n\nDon't forget to check unit tests found under src/test/java!\n\n### Hello World\n\nTo run the hello world samples:\n\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivity\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivityRetry\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsync\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncActivityCompletion\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncLambda\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloChild\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloException\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloPeriodic\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloQuery\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloSignal\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloSearchAttributes\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloCron\n\n### File Processing\n\nThis sample has two executables. Execute each command in a separate terminal window. The first command\nruns the worker that hosts the workflow and activities implementation. To demonstrate that activities\nexecute together, we recommend that you run more than one instance of this worker.\n\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingWorker\n\nThe second command starts workflows. Each invocation starts a new workflow execution.\n\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingStarter\n    \n### Trip Booking\n\nCadence implementation of the [Camunda BPMN trip booking example](https://github.com/berndruecker/trip-booking-saga-java)\n\nDemonstrates Cadence approach to SAGA.\n\nTo run:\n\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.bookingsaga.TripBookingSaga\n\n### Sprint Boot Application\n\nExample of how to start a cadence worker service using Spring Boot Framework\n\nTo run:\n\n    # Start Cadence Server\n    # see https://github.com/uber/cadence/tree/master/docker\n    # register domain\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain\n    ./gradlew -q execute -PmainClass=com.uber.cadence.samples.spring.CadenceSamplesApplication\n","funding_links":[],"categories":["Cadence"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadence-workflow%2Fcadence-java-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcadence-workflow%2Fcadence-java-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadence-workflow%2Fcadence-java-samples/lists"}