This repository contains sample Workflow applications that demonstrate various capabilities of Temporal using the Java SDK.
- Temporal Server repo: https://github.com/temporalio/temporal
- Temporal Java SDK repo: https://github.com/temporalio/sdk-java
- Java SDK docs: https://docs.temporal.io/docs/java/introduction/
-
Clone this repository:
git clone https://github.com/temporalio/samples-java cd samples-java
-
Build the examples and run tests:
./gradlew build
-
You need a locally running Temporal Server instance to run the samples. We recommend a locally running version of the Temporal Server managed via Docker Compose:
git clone https://github.com/temporalio/docker-compose.git cd docker-compose docker-compose up
Note that for the "listworkflows" example you need to have the Elasticsearch feature enabled on the Temporal Server side. To do this you can run locally with:
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose -f docker-compose-cas-es.yml up
Alternatively you could install the Temporal Server on Kubernetes / Minicube using the Temporal Helm charts. Note that in this case you should use the Temporal CLI (tctl) tool to create a namespace called "default":
tctl --ns default n re