Skip to content
Open
55 changes: 52 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,58 @@ jobs:
name: report-dapr-java-sdk-actors-jdk${{ env.JDK_VER }}
path: sdk-actors/target/jacoco-report/

build-durabletask:
name: "Durable Task build & tests"
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: false
env:
JDK_VER: 17
steps:
- uses: actions/checkout@v5
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Checkout Durable Task Sidecar
uses: actions/checkout@v4
with:
repository: dapr/durabletask-go
path: durabletask-sidecar

# TODO: Move the sidecar into a central image repository
- name: Initialize Durable Task Sidecar
run: docker run -d --name durabletask-sidecar -p 4001:4001 --rm -i $(docker build -q ./durabletask-sidecar)

- name: Display Durable Task Sidecar Logs
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &

# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
- name: Wait for 10 seconds
run: sleep 10

- name: Integration Tests For Durable Tasks
run: ./mvnw -B -pl durabletask-client -Pintegration-tests dependency:copy-dependencies verify || echo "TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Kill Durable Task Sidecar
run: docker kill durabletask-sidecar

- name: Upload Durable Task Sidecar Logs
uses: actions/upload-artifact@v4
with:
name: Durable Task Sidecar Logs
path: durabletask-sidecar.log

- name: Fail the job if tests failed
if: env.TEST_FAILED == 'true'
run: exit 1

build:
name: "Build jdk:${{ matrix.java }} sb:${{ matrix.spring-boot-display-version }} exp:${{ matrix.experimental }}"
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 45
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -152,7 +200,7 @@ jobs:
run: ./mvnw clean install -B -q -DskipTests
- name: Integration tests using spring boot version ${{ matrix.spring-boot-version }}
id: integration_tests
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -Pintegration-tests dependency:copy-dependencies verify
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -pl !durabletask-client -Pintegration-tests dependency:copy-dependencies verify
env:
DOCKER_HOST: ${{steps.setup_docker.outputs.sock}}
- name: Upload failsafe test report for sdk-tests on failure
Expand All @@ -168,9 +216,10 @@ jobs:
name: surefire-report-sdk-tests-jdk${{ matrix.java }}-sb${{ matrix.spring-boot-version }}
path: sdk-tests/target/surefire-reports


publish:
runs-on: ubuntu-latest
needs: [ build, test ]
needs: [ build, test, build-durabletask ]
timeout-minutes: 30
env:
JDK_VER: 17
Expand Down
163 changes: 163 additions & 0 deletions durabletask-client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk-parent</artifactId>
<version>1.17.0-SNAPSHOT</version>
</parent>

<artifactId>durabletask-client</artifactId>

<properties>
<protobuf.output.directory>${project.build.directory}/generated-sources</protobuf.output.directory>
<protobuf.input.directory>${project.build.directory}/proto</protobuf.input.directory>
</properties>

<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>getDaprProto</id>
<phase>initialize</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<skipCache>true</skipCache>
<url>${durabletask.proto.url}</url>
<outputFileName>orchestrator_service.proto</outputFileName>
<outputDirectory>${protobuf.input.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>${protobuf.input.directory}</protoSourceRoot>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<notimestamp>true</notimestamp>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<!-- Skip findbugs for auto-generated code -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2025 The Dapr Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
limitations under the License.
*/

package io.dapr.durabletask;

import java.util.ArrayList;
import java.util.List;

/**
* Exception that gets thrown when multiple {@link Task}s for an activity or sub-orchestration fails with an
* unhandled exception.
*
* <p>Detailed information associated with each task failure can be retrieved using the {@link #getExceptions()}
* method.</p>
*/
public class CompositeTaskFailedException extends RuntimeException {
private final List<Exception> exceptions;

CompositeTaskFailedException() {
this.exceptions = new ArrayList<>();
}

CompositeTaskFailedException(List<Exception> exceptions) {
this.exceptions = exceptions;
}

CompositeTaskFailedException(String message, List<Exception> exceptions) {
super(message);
this.exceptions = exceptions;
}

CompositeTaskFailedException(String message, Throwable cause, List<Exception> exceptions) {
super(message, cause);
this.exceptions = exceptions;
}

CompositeTaskFailedException(Throwable cause, List<Exception> exceptions) {
super(cause);
this.exceptions = exceptions;
}

CompositeTaskFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace,
List<Exception> exceptions) {
super(message, cause, enableSuppression, writableStackTrace);
this.exceptions = exceptions;
}

/**
* Gets a list of exceptions that occurred during execution of a group of {@link Task}.
* These exceptions include details of the task failure and exception information
*
* @return a list of exceptions
*/
public List<Exception> getExceptions() {
return new ArrayList<>(this.exceptions);
}

}
Loading
Loading