Skip to content

Releases: microsoft/durabletask-java

v1.5.0

06 Nov 16:01
81a8e7e
Compare
Choose a tag to compare

Updates

  • Fix exception type issue when using RetriableTask in fan in/out pattern (#174)
  • Add implementation to generate name-based deterministic UUID (#176)
  • Update dependencies to resolve CVEs (#177)

v1.4.0

08 Sep 14:42
e938278
Compare
Choose a tag to compare

Updates

  • Refactor createTimer to be non-blocking (#161)

v1.3.0

27 Jul 16:12
0f1acdc
Compare
Choose a tag to compare

Updates

  • Refactor RetriableTask and add new CompoundTask, fixing Fan-out/Fan-in stuck when using RetriableTask (#157)

v1.2.0

13 Jul 13:35
Compare
Choose a tag to compare

v1.2.0

Updates

  • Add thenAccept and thenApply to Task interface (#148)
  • Support Suspend and Resume Client APIs (#151)
  • Support restartInstance and pass restartPostUri in HttpManagementPayload (#108)
  • Improve TaskOrchestrationContext#continueAsNew method so it doesn't require return statement right after it anymore (#150)

v1.1.1

20 Jun 14:35
Compare
Choose a tag to compare

Updates

  • Fix exception occurring when invoking the TaskOrchestrationContext#continueAsNew method (#118)

v1.1.0

27 Apr 22:30
Compare
Choose a tag to compare

Updates

  • Fix the potential NPE issue of DurableTaskClient#terminate method (#104)
  • Add waitForCompletionOrCreateCheckStatusResponse client API (#115)
  • Support long timers by breaking up into smaller timers (#114)

v1.0.0

01 Dec 21:00
a693a4f
Compare
Choose a tag to compare

New

  • Add CHANGELOG.md file to track changes across versions

Updates

  • Updated DataConverterException with detail error message (#78)
  • Updated OrchestratorBlockedEvent and TaskFailedException to be unchecked exceptions (#88)
  • update dependency azure-functions-java-library to 2.2.0 - include azure-functions-java-spi as compileOnly dependency (#95)

Breaking changes

  • Use java worker middleware to avoid wrapper method when create orchestrator function (#87)
  • Fixed DurableClientContext.createCheckStatusResponse to return 202 (#92)
  • context.allOf() throws CompositeTaskFailedException(RuntimeException) when one or more tasks fail instead of RuntimeException (#54)
  • Updated DurableTaskClient.purgeInstances(...) to take a timeout parameter and throw TimeoutException (#37)
  • The waitForInstanceStart(...) and waitForInstanceCompletion(...) methods of the DurableTaskClient interface now throw a checked TimeoutException

Code pattern updates

Before version 1.0.0, the orchestrator function needs to be wrapped by a OrchestrationRunner.loadAndRun wrapper function, accept a String parameter, and return a String result, as below:

    /**
     * This is the orchestrator function. The OrchestrationRunner.loadAndRun() static
     * method is used to take the function input and execute the orchestrator logic.
     */
    @FunctionName("Cities")
    public String citiesOrchestrator(
            @DurableOrchestrationTrigger(name = "orchestratorRequestProtoBytes") String orchestratorRequestProtoBytes) {
        return OrchestrationRunner.loadAndRun(orchestratorRequestProtoBytes, ctx -> {
            String result = "";
            result += ctx.callActivity("Capitalize", "Tokyo", String.class).await() + ", ";
            result += ctx.callActivity("Capitalize", "London", String.class).await() + ", ";
            result += ctx.callActivity("Capitalize", "Seattle", String.class).await() + ", ";
            result += ctx.callActivity("Capitalize", "Austin", String.class).await();
            return result;
        });
    }

From version 1.0.0, the orchestrator function doesn't need the wrapper function anymore. Instead, it takes a TaskOrchestrationContext parameter directly and can return any serializable return value, as below:

    /**
     * This is the orchestrator function. The OrchestrationRunner.loadAndRun() static
     * method is used to take the function input and execute the orchestrator logic.
     */
    @FunctionName("Cities")
    public String citiesOrchestrator(
            @DurableOrchestrationTrigger(name = "taskOrchestrationContext") TaskOrchestrationContext ctx) {
        String result = "";
        result += ctx.callActivity("Capitalize", "Tokyo", String.class).await() + ", ";
        result += ctx.callActivity("Capitalize", "London", String.class).await() + ", ";
        result += ctx.callActivity("Capitalize", "Seattle", String.class).await() + ", ";
        result += ctx.callActivity("Capitalize", "Austin", String.class).await();
        return result;
    }

This change makes the process of writing orchestrator functions simpler more consistent with the rest of the Azure Functions experience.

If you don't change your orchestrator function code and leave in the OrchestrationRunner.loadAndRun(...) wrapper, the execution of the orchestrator function to fail instantly with an error that looks like the following:

[2022-12-06T21:19:49.172Z] Dec 06, 2022 1:19:49 PM com.microsoft.durabletask.TaskOrchestrationExecutor execute
[2022-12-06T21:19:49.172Z] WARNING: The orchestrator failed with an unhandled exception: java.lang.RuntimeException: Unexpected failure in the task execution

This happens because the wrapper call is now redundant. This logic has been abstracted away in Durable Functions-specific middleware and calling it a second time in your function code will fail due to an unexpected input format.

Maven Central Packages

durabletask-azure-functions
durabletask-client