Skip to content

Commit c4541e0

Browse files
authored
Merge branch 'master' into feature/jobs-api
2 parents 5628ef5 + cb552ba commit c4541e0

File tree

137 files changed

+6056
-1137
lines changed

Some content is hidden

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

137 files changed

+6056
-1137
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 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.14.0-rc.6
42-
DAPR_RUNTIME_VER: 1.14.0-rc.6
43-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.14.0-rc.4/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
@@ -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:

.github/workflows/validate.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
GOARCH: amd64
3838
GOPROXY: https://proxy.golang.org
3939
JDK_VER: ${{ matrix.java }}
40-
DAPR_CLI_VER: 1.14.0-rc.6
41-
DAPR_RUNTIME_VER: 1.14.0-rc.6
42-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.14.0-rc.3/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:
@@ -160,3 +160,7 @@ jobs:
160160
working-directory: ./examples
161161
run: |
162162
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.spring.data.DaprKeyValueAdapterResolver;
17+
import org.springframework.boot.context.properties.ConfigurationProperties;
18+
19+
@ConfigurationProperties(prefix = "dapr.client")
20+
public class DaprClientProperties {
21+
private String httpEndpoint;
22+
private String grpcEndpoint;
23+
private Integer httpPort;
24+
private Integer grpcPort;
25+
26+
27+
/**
28+
* Constructs a {@link DaprClientProperties}.
29+
*/
30+
public DaprClientProperties() {
31+
}
32+
33+
/**
34+
* Constructs a {@link DaprClientProperties}.
35+
* @param httpEndpoint http endpoint to interact with the Dapr Sidecar
36+
* @param grpcEndpoint grpc endpoint to interact with the Dapr Sidecar
37+
* @param httpPort http port to interact with the Dapr Sidecar
38+
* @param grpcPort grpc port to interact with the Dapr Sidecar
39+
*/
40+
public DaprClientProperties(String httpEndpoint, String grpcEndpoint, Integer httpPort, Integer grpcPort) {
41+
this.httpEndpoint = httpEndpoint;
42+
this.grpcEndpoint = grpcEndpoint;
43+
this.httpPort = httpPort;
44+
this.grpcPort = grpcPort;
45+
}
46+
47+
public String getHttpEndpoint() {
48+
return httpEndpoint;
49+
}
50+
51+
public String getGrpcEndpoint() {
52+
return grpcEndpoint;
53+
}
54+
55+
public Integer getHttpPort() {
56+
return httpPort;
57+
}
58+
59+
public Integer getGrpcPort() {
60+
return grpcPort;
61+
}
62+
63+
public void setHttpEndpoint(String httpEndpoint) {
64+
this.httpEndpoint = httpEndpoint;
65+
}
66+
67+
public void setGrpcEndpoint(String grpcEndpoint) {
68+
this.grpcEndpoint = grpcEndpoint;
69+
}
70+
71+
public void setHttpPort(Integer httpPort) {
72+
this.httpPort = httpPort;
73+
}
74+
75+
public void setGrpcPort(Integer grpcPort) {
76+
this.grpcPort = grpcPort;
77+
}
78+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
17+
18+
public interface DaprConnectionDetails extends ConnectionDetails {
19+
String httpEndpoint();
20+
21+
String grpcEndpoint();
22+
23+
Integer httpPort();
24+
25+
Integer grpcPort();
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
class PropertiesDaprConnectionDetails implements DaprConnectionDetails {
17+
18+
private final DaprClientProperties daprClientProperties;
19+
20+
public PropertiesDaprConnectionDetails(DaprClientProperties daprClientProperties) {
21+
this.daprClientProperties = daprClientProperties;
22+
}
23+
24+
@Override
25+
public String httpEndpoint() {
26+
return this.daprClientProperties.getHttpEndpoint();
27+
}
28+
29+
@Override
30+
public String grpcEndpoint() {
31+
return this.daprClientProperties.getGrpcEndpoint();
32+
}
33+
34+
@Override
35+
public Integer httpPort() {
36+
return this.daprClientProperties.getHttpPort();
37+
}
38+
39+
@Override
40+
public Integer grpcPort() {
41+
return this.daprClientProperties.getGrpcPort();
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.pubsub;
15+
16+
import org.springframework.boot.context.properties.ConfigurationProperties;
17+
18+
19+
@ConfigurationProperties(prefix = DaprPubSubProperties.CONFIG_PREFIX)
20+
public class DaprPubSubProperties {
21+
22+
public static final String CONFIG_PREFIX = "dapr.pubsub";
23+
24+
/**
25+
* Name of the PubSub Dapr component.
26+
*/
27+
private String name;
28+
29+
public String getName() {
30+
return name;
31+
}
32+
33+
public void setName(String name) {
34+
this.name = name;
35+
}
36+
37+
}

0 commit comments

Comments
 (0)