Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In this scenario the nullability constraints will not be validated locally but r

Before submitting a PR, please run the following commands to ensure proper formatting and Javadoc processing

```
```shell
./mvnw spring-javaformat:apply javadoc:javadoc -Pjavadoc
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For further information go to our [Spring gRPC reference documentation](https://
# Getting Started

**📌 NOTE**\
Spring gRPC `1.0.x` supports Spring Boot `4.0.x`
Spring gRPC `1.0.x` supports Spring Boot `4.1.x`

This section offers jumping off points for how to get started using Spring gRPC. There is a simple sample project in the `samples` directory (e.g. [`grpc-server`](https://github.com/spring-projects/spring-grpc/tree/main/samples/grpc-server)). You can run it with `mvn spring-boot:run` or `gradle bootRun`. You will see the following code in that sample.

Expand Down
7 changes: 2 additions & 5 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/bash

# Be sure the ConfigurationPropertiesAsciidocGenerator is compiled
./mvnw -pl spring-grpc-docs package

# Generate the config props and antora site
./mvnw -pl spring-grpc-docs process-resources antora -P docs
# Generate the README.md, CONTRIBUTING.md and the Antora site
./mvnw -pl spring-grpc-docs package antora
18 changes: 4 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,7 @@
<module>spring-grpc-core</module>
<module>spring-grpc-dependencies</module>
<module>spring-grpc-docs</module>
<module>samples</module>

<!-- Spring Boot modules -->
<module>spring-grpc-client-spring-boot-autoconfigure</module>
<module>spring-grpc-client-spring-boot-starter</module>
<module>spring-grpc-server-spring-boot-autoconfigure</module>
<module>spring-grpc-server-spring-boot-starter</module>
<module>spring-grpc-server-web-spring-boot-starter</module>
<module>spring-grpc-spring-boot-starter</module>
<module>spring-grpc-test</module>
<module>spring-grpc-test-spring-boot-autoconfigure</module>
<!-- <module>samples</module>-->
</modules>

<organization>
Expand Down Expand Up @@ -82,10 +72,10 @@
<java.version>17</java.version>
<!-- internal dependencies -->
<spring-boot.version>4.1.0-M1</spring-boot.version>
<jackson.version>2.21.0</jackson.version>
<junit.version>6.0.2</junit.version>
<jackson.version>2.21.1</jackson.version>
<junit.version>6.0.3</junit.version>
<kotlin.coroutines.version>1.10.2</kotlin.coroutines.version>
<assertj.version>3.27.6</assertj.version>
<assertj.version>3.27.7</assertj.version>
<awaitility.version>4.3.0</awaitility.version>
<mockito.version>5.21.0</mockito.version>
<!-- documentation dependencies -->
Expand Down
14 changes: 7 additions & 7 deletions samples/grpc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0-GRPC-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.grpc</groupId>
Expand All @@ -30,8 +30,8 @@
<properties>
<java.version>17</java.version>
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
<protobuf-java.version>4.33.2</protobuf-java.version>
<grpc.version>1.77.1</grpc.version>
<protobuf-java.version>4.34.0</protobuf-java.version>
<grpc.version>1.79.0</grpc.version>
<maven.version>3.9.4</maven.version>
<maven.resolver.version>1.9.18</maven.resolver.version>
</properties>
Expand All @@ -49,13 +49,13 @@

<dependencies>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-client-spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-client</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.application.name=grpc-client
spring.grpc.client.default-channel.address=static://0.0.0.0:${launched.grpc.port:9090}
spring.grpc.client.channel.default.target=static://0.0.0.0:${launched.grpc.port:9090}

#logging.level.org.springframework.experimental.boot.server.exec=debug
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.File;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
Expand All @@ -18,17 +19,20 @@
import org.springframework.experimental.boot.server.exec.MavenClasspathEntry;
import org.springframework.experimental.boot.test.context.DynamicProperty;
import org.springframework.experimental.boot.test.context.EnableDynamicProperty;
import org.springframework.grpc.client.ImportGrpcClients;
import org.springframework.grpc.sample.proto.HelloRequest;
import org.springframework.grpc.sample.proto.SimpleGrpc;
import org.springframework.test.annotation.DirtiesContext;

import io.grpc.Status;
import io.grpc.StatusRuntimeException;

@ImportGrpcClients
@Disabled("Need to migrate to Spring Boot 4.1.x")
public class DefaultDeadlineSetupTests {

@Nested
@SpringBootTest(properties = "spring.grpc.client.default-channel.default-deadline=1s")
@SpringBootTest(properties = "spring.grpc.client.channel.default.default-deadline=1s")
@DirtiesContext
@EnabledIf("serverJarAvailable")
class Deadline {
Expand Down Expand Up @@ -76,7 +80,7 @@ public CommandLineRunner otherRunner(SimpleGrpc.SimpleBlockingStub stub) {
}

@Nested
@SpringBootTest(properties = "spring.grpc.client.default-channel.default-deadline=1s")
@SpringBootTest(properties = "spring.grpc.client.channel.default.default-deadline=1s")
@DirtiesContext
@EnabledIf("serverJarAvailable")
class WithoutDeadline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
import org.springframework.experimental.boot.server.exec.MavenClasspathEntry;
import org.springframework.experimental.boot.test.context.DynamicProperty;
import org.springframework.experimental.boot.test.context.EnableDynamicProperty;
import org.springframework.grpc.client.ImportGrpcClients;
import org.springframework.test.annotation.DirtiesContext;

@SpringBootTest
@DirtiesContext
@EnabledIf("serverJarAvailable")
@ImportGrpcClients
public class GrpcClientApplicationTests {

public static void main(String[] args) {
Expand Down
18 changes: 11 additions & 7 deletions samples/grpc-oauth2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0-GRPC-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.grpc</groupId>
Expand All @@ -30,8 +30,8 @@
<properties>
<java.version>17</java.version>
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
<protobuf-java.version>4.33.2</protobuf-java.version>
<grpc.version>1.77.1</grpc.version>
<protobuf-java.version>4.34.0</protobuf-java.version>
<grpc.version>1.79.0</grpc.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -46,17 +46,21 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.concurrent.atomic.AtomicReference;

import org.awaitility.Awaitility;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -38,9 +39,10 @@
import io.grpc.reflection.v1.ServerReflectionResponse;
import io.grpc.stub.StreamObserver;

@SpringBootTest(properties = { "spring.grpc.server.port=0",
"spring.grpc.client.default-channel.address=static://0.0.0.0:${local.grpc.port}" })
@SpringBootTest(properties = { "spring.grpc.server.address=0.0.0.0:0",
"spring.grpc.client.channel.default.target=static://0.0.0.0:${local.grpc.sever.port}" })
@DirtiesContext
@Disabled("Need to migrate to Spring Boot 4.1.x")
public class GrpcServerApplicationTests {

public static void main(String[] args) {
Expand Down
18 changes: 11 additions & 7 deletions samples/grpc-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0-GRPC-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.grpc</groupId>
Expand All @@ -30,8 +30,8 @@
<properties>
<java.version>17</java.version>
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
<protobuf-java.version>4.33.2</protobuf-java.version>
<grpc.version>1.77.1</grpc.version>
<protobuf-java.version>4.34.0</protobuf-java.version>
<grpc.version>1.79.0</grpc.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -46,8 +46,12 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -71,8 +75,8 @@
</dependency>

<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.grpc.test.autoconfigure.AutoConfigureInProcessTransport;
import org.springframework.boot.grpc.test.autoconfigure.AutoConfigureTestGrpcTransport;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.grpc.client.ImportGrpcClients;
Expand All @@ -20,7 +20,7 @@

@SpringBootTest
@DirtiesContext
@AutoConfigureInProcessTransport
@AutoConfigureTestGrpcTransport
public class GrpcServerApplicationTests {

private static Log log = LogFactory.getLog(GrpcServerApplicationTests.class);
Expand Down
18 changes: 11 additions & 7 deletions samples/grpc-secure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.0-M1</version>
<version>4.1.0-GRPC-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.grpc</groupId>
Expand All @@ -30,8 +30,8 @@
<properties>
<java.version>17</java.version>
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
<protobuf-java.version>4.33.2</protobuf-java.version>
<grpc.version>1.77.1</grpc.version>
<protobuf-java.version>4.34.0</protobuf-java.version>
<grpc.version>1.79.0</grpc.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -46,17 +46,21 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.concurrent.atomic.AtomicReference;

import org.awaitility.Awaitility;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand All @@ -29,9 +30,10 @@
import io.grpc.reflection.v1.ServerReflectionResponse;
import io.grpc.stub.StreamObserver;

@SpringBootTest(properties = { "spring.grpc.server.port=0",
"spring.grpc.client.default-channel.address=static://0.0.0.0:${local.grpc.port}" })
@SpringBootTest(properties = { "spring.grpc.server.address=0.0.0.0:0",
"spring.grpc.client.channel.default.target=static://0.0.0.0:${local.grpc.sever.port}" })
@DirtiesContext
@Disabled("Need to migrate to Spring Boot 4.1.x")
public class GrpcServerApplicationTests {

public static void main(String[] args) {
Expand Down
Loading
Loading