Java | Durable Functions
This quickstart demonstrates Durable Functions with Java using the Durable Task Scheduler backend. It includes two patterns:
- Function Chaining — An orchestration that calls three "say hello" activities sequentially for different cities
- Fan-out/Fan-in — An orchestration that greets multiple cities in parallel and aggregates the results
- Java 11+ (JDK)
- Maven
- Azure Functions Core Tools v4
- Docker (for the emulator)
-
Start the emulator:
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
-
Build and run:
cd samples/durable-functions/java/HelloCities mvn clean package func start -
Trigger the function chaining orchestration:
curl -X POST http://localhost:7071/api/StartChaining
-
Trigger the fan-out/fan-in orchestration:
curl -X POST http://localhost:7071/api/StartFanOutFanIn
-
View in the dashboard: http://localhost:8082
The chaining orchestration greets Tokyo, Seattle, and London sequentially:
Hello Tokyo! Hello Seattle! Hello London!
The fan-out/fan-in orchestration greets all three cities in parallel and returns aggregated results.