grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.48k stars 812 forks source link

The gRPC server does not start, Java #952

Open Aberkingaliev opened 1 year ago

Aberkingaliev commented 1 year ago

Labeled the class with the annotation @GrpcServer

@GrpcService
public class UserService extends UserGrpc.UserImplBase {...code}

I'm using it together with spring boot web.

Gradle dependencies:

dependencies {
implementation 'net.devh:grpc-server-spring-boot-starter:2.14.0.RELEASE'
implementation 'net.devh:grpc-server-spring-boot-autoconfigure:2.14.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.postgresql:postgresql:42.6.0'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.flywaydb:flyway-core'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.grpc:grpc-testing:1.57.2'
}

There is nothing about gRPC in the startup logs, no error or useful information, not even in DEBUG level

Aberkingaliev commented 1 year ago

Perhaps something else is needed besides the @GrpcService annotation and extension?

piomin commented 1 year ago

Nothing more. The question is which version of Spring Boot do you use?

Aberkingaliev commented 1 year ago

Was using the latest version of Spring boot Then I decided to roll back to 2.6.13 Everything worked, apparently there is no support for newer versions of Spring.

marcindabrowski commented 1 year ago

Actually it is. You have to add @ImportAutoConfiguration(GrpcClientAutoConfiguration.class) to your configuration. Current version of the starter do not have autoconfiguration file in format supported from 2.7, and old one is not supported since 3.0.

FyiurAmron commented 12 months ago

@Aberkingaliev see https://github.com/yidongnan/grpc-spring-boot-starter/issues/778#issuecomment-1569362944 , full context: https://github.com/yidongnan/grpc-spring-boot-starter/issues/953