Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Hello Cities — Durable Functions Java Quickstart

Java | Durable Functions

Description

This quickstart demonstrates Durable Functions with Java using the Durable Task Scheduler backend. It includes two patterns:

  1. Function Chaining — An orchestration that calls three "say hello" activities sequentially for different cities
  2. Fan-out/Fan-in — An orchestration that greets multiple cities in parallel and aggregates the results

Prerequisites

  1. Java 11+ (JDK)
  2. Maven
  3. Azure Functions Core Tools v4
  4. Docker (for the DTS emulator and Azurite)

Quick Run

  1. Start the Durable Task Scheduler emulator:

    docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
  2. Start Azurite for Azure Functions host storage:

    docker run --name azurite -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
  3. Build the sample:

    cd samples/durable-functions/java/HelloCities
    mvn clean package
  4. Run the Functions host:

    mvn azure-functions:run
  5. Trigger the function chaining orchestration:

    curl -X POST http://localhost:7071/api/StartChaining
  6. Trigger the fan-out/fan-in orchestration:

    curl -X POST http://localhost:7071/api/StartFanOutFanIn
  7. View in the dashboard: http://localhost:8082

Notes

  • mvn clean package is configured to stage the Azure Functions app so mvn azure-functions:run works as a separate second step.
  • AzureWebJobsStorage=UseDevelopmentStorage=true requires Azurite to be running locally.
  • DURABLE_TASK_SCHEDULER_CONNECTION_STRING in local.settings.json points to the local DTS emulator on http://localhost:8080.

Expected Output

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.

Learn More