The sample is configured by default to connect to a local Temporal Server running on localhost:7233.
To instead connect to Temporal Cloud, set the following environment variables, replacing them with your own Temporal Cloud credentials:
TEMPORAL_ADDRESS=testnamespace.sdvdw.tmprl.cloud:7233
TEMPORAL_NAMESPACE=testnamespace.sdvdw
TEMPORAL_CERT_PATH="/path/to/file.pem"
TEMPORAL_KEY_PATH="/path/to/file.key"
./gradlew -q execute -PmainClass=io.temporal.samples.ordersaga.Worker
- Splits a list of SKUs into two groups:
- For processing by the legacy system
- For processing by the new system
- The 'subtract' operation is run on each system (in parallel)
- If a failure in either system occurs, the workflow will run a compensation to 'reverse' the subtract operation in both systems
./gradlew -q execute -PmainClass=io.temporal.samples.ordersaga.splittrafficsubtract.Caller
- Uncomment either of the exceptions in SubtractActivityImpl to cause that system's subtract operation to fail
- Restart your worker, then re-run the workflow
- Accepts a quantity of items to allocate across containers
- Runs
getContainerRecommendation
with hard-coded results:- 4 containers to allocate quantity to
- Each container has 100 items in it
- Iterates through the list of containers (sequentially)
- Allocates 100 items to each container until the quantity is reached and finishes the workflow
Providing a quantity of 350 will succeed:
./gradlew -q execute -PmainClass=io.temporal.samples.ordersaga.containerallocation.Caller -Parg=350
- If the quantity requested is greater than 400, the workflow will fail due to insufficient allocation
- If an allocation fails, the workflow will run a compensation to 'reverse' the allocations in all containers
Example: Providing a quantity of 470 will fail due to insufficient containers (4 containers have 100 items each):
./gradlew -q execute -PmainClass=io.temporal.samples.ordersaga.containerallocation.Caller -Parg=350