Add Java Durable Task SDK sample for Work Item Filtering#276
Add Java Durable Task SDK sample for Work Item Filtering#276bachuv wants to merge 2 commits intoAzure-Samples:mainfrom
Conversation
|
Tested this PR locally end-to-end against the DTS emulator (built All functional checklist items pass: orchestrations complete 3/3 across batches, each worker only processes its registered work item types (Orchestrator: 30 dispatches / 0 activities; Validator: 36 ValidateOrder / 0 ShipOrder / 0 orchestrations; Shipper: 24 ShipOrder / 0 ValidateOrder / 0 orchestrations), the strict-routing experiment works as documented (stop Shipper → ShipOrder backlogs, restart → backlog drains immediately), and Found four issues worth addressing before merge: 1.
|
Purpose
Adds a Java port of the Work Item Filtering split activities scenario sample (
samples/scenarios/WorkItemFilteringSplitActivitiesJava), using the standalone Durable Task SDK (not Durable Functions). This demonstrates the newuseWorkItemFilters()API from durabletask-java v1.9.0 to route orchestration and activity work items to dedicated workers.What's included
OrderProcessingOrchestrationValidateOrderactivityShipOrderactivityConnectionHelper— builds DTS connection strings from environment variables (emulator, Managed Identity, DefaultAzure)azure.yamlfor one-commandazd updeployment to Azure Container Apps with KEDA scalingHow it works
Each worker calls
.useWorkItemFilters()on theDurableTaskGrpcWorkerBuilderto auto-generate filters from registered tasks. DTS routes work items only to workers with matching filters — no cross-processing occurs.Tested locally
Verified end-to-end against the DTS emulator (
mcr.microsoft.com/dts/dts-emulator:latest):ValidateOrderactivitiesShipOrderactivitiesRelated
samples/scenarios/WorkItemFilteringSplitActivitiesDoes this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
git clone https://github.com/Azure-Samples/Durable-Task-Scheduler.git cd Durable-Task-Scheduler git checkout vabachu/work-item-filters-javacd samples/scenarios/WorkItemFilteringSplitActivitiesJava ./gradlew buildWhat to Check
Verify that the following are valid:
ValidateOrderactivity work itemsShipOrderactivity work itemsShipOrderwork items to remain pending (not routed to other workers)ShipOrderwork items to complete immediatelyOther Information
durabletask-client:1.9.0anddurabletask-azuremanaged:1.9.0from Maven local (not yet published to Maven Central)