Skip to content

Commit 54343d1

Browse files
authored
Merge branch 'master' into actor_ttl
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2 parents 23ab28f + 3dc96d7 commit 54343d1

File tree

1,424 files changed

+57104
-18786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,424 files changed

+57104
-18786
lines changed

.github/scripts/update_docs.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ set -uex
44

55
DAPR_JAVA_SDK_VERSION=$1
66

7+
# Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major.
8+
# Replaces the SDK major version to 0 for alpha artifacts.
9+
DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'`
10+
711
if [[ "$OSTYPE" == "darwin"* ]]; then
812
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
913
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
1014
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
1115
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
16+
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
1217
rm README.mdbak
1318
else
1419
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
1520
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
1621
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
1722
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
23+
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
1824
fi
1925

20-
rm -rf docs
21-
mvn -Dmaven.test.skip=false -Djacoco.skip=true clean install
22-
mvn site-deploy
2326
rm -f daprdocs/content/en/java-sdk-docs/_index.mdbak || echo
27+
rm -f daprdocs/content/en/java-sdk-docs/spring-boot/_index.md/_index.mdbak || echo
28+
29+
rm -rf docs
30+
./mvnw -Dmaven.test.skip=false -Djacoco.skip=true clean install
31+
./mvnw site-deploy

.github/scripts/update_sdk_version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'
1010

1111
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION
1212
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION
13+
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION
1314
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-tests/pom.xml
1415
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-tests/pom.xml
1516

@@ -23,4 +24,7 @@ mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-workflows/pom.
2324
# testcontainers-dapr
2425
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f testcontainers-dapr/pom.xml
2526

27+
# dapr-spring
28+
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f dapr-spring/pom.xml
29+
2630
git clean -f

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
GOARCH: amd64
3939
GOPROXY: https://proxy.golang.org
4040
JDK_VER: ${{ matrix.java }}
41-
DAPR_CLI_VER: 1.13.0-rc.1
42-
DAPR_RUNTIME_VER: 1.13.0-rc.2
43-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.13.0-rc.1/install/install.sh
41+
DAPR_CLI_VER: 1.14.0
42+
DAPR_RUNTIME_VER: 1.14.4
43+
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.14.0/install/install.sh
4444
DAPR_CLI_REF:
4545
DAPR_REF:
4646
TOXIPROXY_URL: https://github.com/Shopify/toxiproxy/releases/download/v2.5.0/toxiproxy-server-linux-amd64
@@ -49,7 +49,7 @@ jobs:
4949
- name: Set up OpenJDK ${{ env.JDK_VER }}
5050
uses: actions/setup-java@v4
5151
with:
52-
distribution: 'adopt'
52+
distribution: 'temurin'
5353
java-version: ${{ env.JDK_VER }}
5454
- name: Set up Dapr CLI
5555
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
@@ -119,7 +119,7 @@ jobs:
119119
run: ./mvnw install -q -B -DskipTests
120120
- name: Integration tests using spring boot version ${{ matrix.spring-boot-version }}
121121
id: integration_tests
122-
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -f sdk-tests/pom.xml verify
122+
run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} ./mvnw -B -Pintegration-tests verify
123123
- name: Upload test report for sdk
124124
uses: actions/upload-artifact@v4
125125
with:
@@ -158,7 +158,7 @@ jobs:
158158
- name: Set up OpenJDK ${{ env.JDK_VER }}
159159
uses: actions/setup-java@v4
160160
with:
161-
distribution: 'adopt'
161+
distribution: 'temurin'
162162
java-version: ${{ env.JDK_VER }}
163163
- name: Get pom parent version
164164
run: |
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Validate Javadocs Generation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- release-*
9+
tags:
10+
- v*
11+
12+
pull_request:
13+
branches:
14+
- master
15+
- release-*
16+
17+
jobs:
18+
build:
19+
name: "Validate Javadocs generation"
20+
runs-on: linux-arm64-latest-4-cores
21+
timeout-minutes: 30
22+
env:
23+
JDK_VER: 17
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up OpenJDK ${{ env.JDK_VER }}
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: 'temurin'
30+
java-version: ${{ env.JDK_VER }}
31+
- name: Install jars
32+
run: ./mvnw install -q -B -DskipTests
33+
- name: Validate Java docs generation
34+
run: ./mvnw site-deploy

.github/workflows/validate.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737
GOARCH: amd64
3838
GOPROXY: https://proxy.golang.org
3939
JDK_VER: ${{ matrix.java }}
40-
DAPR_CLI_VER: 1.13.0-rc.1
41-
DAPR_RUNTIME_VER: 1.13.0-rc.5
42-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.13.0-rc.1/install/install.sh
40+
DAPR_CLI_VER: 1.14.0
41+
DAPR_RUNTIME_VER: 1.14.4
42+
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.14.0/install/install.sh
4343
DAPR_CLI_REF:
4444
DAPR_REF:
4545
steps:
4646
- uses: actions/checkout@v4
4747
- name: Set up OpenJDK ${{ env.JDK_VER }}
4848
uses: actions/setup-java@v4
4949
with:
50-
distribution: 'adopt'
50+
distribution: 'temurin'
5151
java-version: ${{ env.JDK_VER }}
5252
- name: Set up Dapr CLI
5353
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
@@ -100,6 +100,8 @@ jobs:
100100
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
101101
pip3 install setuptools wheel
102102
pip3 install mechanical-markdown
103+
- name: Verify scheduler is listening on port.
104+
run: sleep 30 && docker logs dapr_scheduler && nc -vz localhost 50006
103105
- name: Clean up files
104106
run: ./mvnw clean
105107
- name: Build sdk
@@ -158,3 +160,7 @@ jobs:
158160
working-directory: ./examples
159161
run: |
160162
mm.py ./src/main/java/io/dapr/examples/workflows/README.md
163+
- name: Validate streaming subscription example
164+
working-directory: ./examples
165+
run: |
166+
mm.py ./src/main/java/io/dapr/examples/pubsub/stream/README.md

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ For a Maven project, add the following to your `pom.xml` file:
4949
<dependency>
5050
<groupId>io.dapr</groupId>
5151
<artifactId>dapr-sdk</artifactId>
52-
<version>1.11.0</version>
52+
<version>1.12.0</version>
5353
</dependency>
5454
<!-- Dapr's SDK for Actors (optional). -->
5555
<dependency>
5656
<groupId>io.dapr</groupId>
5757
<artifactId>dapr-sdk-actors</artifactId>
58-
<version>1.11.0</version>
58+
<version>1.12.0</version>
5959
</dependency>
6060
<!-- Dapr's SDK integration with SpringBoot (optional). -->
6161
<dependency>
6262
<groupId>io.dapr</groupId>
6363
<artifactId>dapr-sdk-springboot</artifactId>
64-
<version>1.11.0</version>
64+
<version>1.12.0</version>
6565
</dependency>
6666
...
6767
</dependencies>
@@ -75,11 +75,11 @@ For a Gradle project, add the following to your `build.gradle` file:
7575
dependencies {
7676
...
7777
// Dapr's core SDK with all features, except Actors.
78-
compile('io.dapr:dapr-sdk:1.11.0')
78+
compile('io.dapr:dapr-sdk:1.12.0')
7979
// Dapr's SDK for Actors (optional).
80-
compile('io.dapr:dapr-sdk-actors:1.11.0')
80+
compile('io.dapr:dapr-sdk-actors:1.12.0')
8181
// Dapr's SDK integration with SpringBoot (optional).
82-
compile('io.dapr:dapr-sdk-springboot:1.11.0')
82+
compile('io.dapr:dapr-sdk-springboot:1.12.0')
8383
}
8484
```
8585

@@ -102,8 +102,10 @@ Try the following examples to learn more about Dapr's Java SDK:
102102
* [Invoking a Grpc service](./examples/src/main/java/io/dapr/examples/invoke/grpc)
103103
* [State management](./examples/src/main/java/io/dapr/examples/state)
104104
* [PubSub with subscriber](./examples/src/main/java/io/dapr/examples/pubsub/)
105+
* [PubSub with streaming subscription](./examples/src/main/java/io/dapr/examples/pubsub/stream/)
105106
* [Binding with input over Http](./examples/src/main/java/io/dapr/examples/bindings/http)
106107
* [Actors](./examples/src/main/java/io/dapr/examples/actors/)
108+
* [Workflows](./examples/src/main/java/io/dapr/examples/workflows/)
107109
* [Secrets management](./examples/src/main/java/io/dapr/examples/secrets)
108110
* [Configuration](./examples/src/main/java/io/dapr/examples/configuration)
109111
* [Distributed tracing with OpenTelemetry SDK](./examples/src/main/java/io/dapr/examples/tracing)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>io.dapr.spring</groupId>
8+
<artifactId>dapr-spring-parent</artifactId>
9+
<version>0.13.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>dapr-spring-boot-autoconfigure</artifactId>
13+
<name>dapr-spring-boot-autoconfigure</name>
14+
<description>Dapr Spring Boot Autoconfigure</description>
15+
<packaging>jar</packaging>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>io.dapr.spring</groupId>
20+
<artifactId>dapr-spring-data</artifactId>
21+
<version>${project.parent.version}</version>
22+
<optional>true</optional>
23+
</dependency>
24+
<dependency>
25+
<groupId>io.dapr.spring</groupId>
26+
<artifactId>dapr-spring-messaging</artifactId>
27+
<version>${project.parent.version}</version>
28+
<optional>true</optional>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-starter</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.springframework.boot</groupId>
36+
<artifactId>spring-boot-autoconfigure-processor</artifactId>
37+
<optional>true</optional>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.data</groupId>
41+
<artifactId>spring-data-keyvalue</artifactId>
42+
<optional>true</optional>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-web</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.testcontainers</groupId>
51+
<artifactId>testcontainers</artifactId>
52+
<scope>test</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.testcontainers</groupId>
56+
<artifactId>junit-jupiter</artifactId>
57+
<scope>test</scope>
58+
<exclusions>
59+
<exclusion>
60+
<groupId>com.vaadin.external.google</groupId>
61+
<artifactId>android-json</artifactId>
62+
</exclusion>
63+
</exclusions>
64+
</dependency>
65+
<dependency>
66+
<groupId>io.dapr</groupId>
67+
<artifactId>testcontainers-dapr</artifactId>
68+
<version>${dapr.sdk.alpha.version}</version>
69+
<scope>test</scope>
70+
</dependency>
71+
</dependencies>
72+
73+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2024 The Dapr Authors
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package io.dapr.spring.boot.autoconfigure.client;
15+
16+
import io.dapr.client.DaprClient;
17+
import io.dapr.client.DaprClientBuilder;
18+
import io.dapr.config.Properties;
19+
import org.springframework.boot.autoconfigure.AutoConfiguration;
20+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
21+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
22+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
23+
import org.springframework.context.annotation.Bean;
24+
25+
@AutoConfiguration
26+
@ConditionalOnClass(DaprClient.class)
27+
@EnableConfigurationProperties(DaprClientProperties.class)
28+
public class DaprClientAutoConfiguration {
29+
30+
@Bean
31+
@ConditionalOnMissingBean(DaprConnectionDetails.class)
32+
DaprConnectionDetails daprConnectionDetails(DaprClientProperties properties) {
33+
return new PropertiesDaprConnectionDetails(properties);
34+
}
35+
36+
@Bean
37+
@ConditionalOnMissingBean
38+
DaprClientBuilder daprClientBuilder(DaprConnectionDetails daprConnectionDetails) {
39+
DaprClientBuilder builder = new DaprClientBuilder();
40+
if (daprConnectionDetails.httpEndpoint() != null) {
41+
builder.withPropertyOverride(Properties.HTTP_ENDPOINT, daprConnectionDetails.httpEndpoint());
42+
}
43+
if (daprConnectionDetails.grpcEndpoint() != null) {
44+
builder.withPropertyOverride(Properties.GRPC_ENDPOINT, daprConnectionDetails.grpcEndpoint());
45+
}
46+
if (daprConnectionDetails.httpPort() != null) {
47+
builder.withPropertyOverride(Properties.HTTP_PORT, String.valueOf(daprConnectionDetails.httpPort()));
48+
}
49+
if (daprConnectionDetails.grpcPort() != null) {
50+
builder.withPropertyOverride(Properties.GRPC_PORT, String.valueOf(daprConnectionDetails.grpcPort()));
51+
}
52+
return builder;
53+
}
54+
55+
@Bean
56+
@ConditionalOnMissingBean
57+
DaprClient daprClient(DaprClientBuilder daprClientBuilder) {
58+
return daprClientBuilder.build();
59+
}
60+
61+
}

0 commit comments

Comments
 (0)