Complete Java implementation for progressive Temporal training exercises.
- Java 17+
- Temporal CLI
- Start Temporal dev server with AccountId search attribute:
temporal server start-dev --search-attribute AccountId=Text- Build project:
./gradlew build- Basic Workflow and Activity setup
- Worker registration and execution
- Multiple activities (withdraw, deposit, refund)
- Signal-based approval mechanism
- Workflow.await() for conditional waiting
- Basic error handling and compensation
- Query methods for workflow state inspection
- Status tracking throughout execution
- External workflow monitoring
- Signal vs Query differences
- Custom Search Attributes (AccountId)
- Upsert Search Attributes from workflows
- Workflow filtering and discovery
- Activity summaries for better observability
- Static workflow summaries
- Enhanced monitoring in Temporal Web UI
- Unit tests with TestWorkflowRule
- Time skipping for fast tests
- Activity mocking with Mockito
- Search attribute registration in tests
- Manual retry pattern using signals
- Invalid data handling scenarios
- Disabling automatic retries
- Interactive retry commands
# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise1.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise1.StartWorkflow# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise2.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise2.StartWorkflow# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise3.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise3.StartWorkflow# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise4.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise4.StartWorkflow# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise5.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise5.StartWorkflow# Run tests
./gradlew test --tests "com.temporal.training.exercise6.MoneyTransferWorkflowTest"# Start worker
./gradlew execute -PmainClass=com.temporal.training.exercise7.StartWorker
# Run workflow (in another terminal)
./gradlew execute -PmainClass=com.temporal.training.exercise7.StartWorkflow
# Send retry signal with corrected data
temporal workflow signal \
--workflow-id money-transfer-workflow \
--name retry \
--input '{"key":"fromAccount","value":"account-123"}'Replace exercise with solution in the class names above to run complete implementations.
- Java 17 Records: Modern data classes
- Activity Retry: Configurable retry policies
- Signal/Query: Workflow interaction patterns
- Search Attributes: Custom filtering
- User Metadata: Activity context
- Compensation: Saga pattern for rollbacks
- Testing: Time-skipping unit tests
- Error Handling: Distinguishes activity vs workflow failures
- Manual Retry: Signal-based retry for failed activities