grpc-spring icon indicating copy to clipboard operation
grpc-spring copied to clipboard

Incompatibility with spring-cloud-gcp (Greenwich)

Open AnswerNo2 opened this issue 3 years ago • 3 comments

macbook pro M1

springcloud version: Greenwich.SR6 springboot cersioin: 2.3.6.RELEASE eureka

when i start my server with eureka, why should register pubsub.googleapi.com:443 on eureka ?

it occured in your project class: DiscoveryClientNameResolver.resolveInternal

image

AnswerNo2 avatar Jan 08 '22 14:01 AnswerNo2

Thanks for providing more information now. Note it is also possible to edit your previous posts instead creating new ones.

why should register pubsub.googleapi.com:443 on eureka ?

You don't. I assume the error here is that some grpc component does not specify how to resolve their address. e.g. it uses pubsub.googleapi.com:443 instead of dns:///pubsub.googleapi.com:443 ManagedChannelBuilder#forTarget(...)

You might be able to add a breakpoint to the constructor to check where that value is from. As an alternative, you can disable the discovery client name resolver by excluding the following class: net.devh.boot.grpc.client.autoconfigure.GrpcDiscoveryClientAutoConfiguration

Potentially related issues:

  • https://github.com/yidongnan/grpc-spring-boot-starter/issues/268
  • https://github.com/spring-cloud/spring-cloud-gcp/pull/2085

Conclusion:

  • The spring-cloud-gpc fix#2085 is contained in release v1.2.1.RELEASE (Hoxton.SR1) and above
  • Greenwich.SR6 ships with Spring Cloud Gcp 1.1.5.RELEASE
  • -> You might have to update gcp or workaround that issue

Does this help you?

ST-DDT avatar Jan 08 '22 15:01 ST-DDT

What's versions of spingcloud and springboot are used in net.devh:grpc-spring-boot-starter version:2.10.0.RELEASE?

AnswerNo2 avatar Jan 09 '22 03:01 AnswerNo2

See here: https://yidongnan.github.io/grpc-spring-boot-starter/en/versions.html#version-2x

There are a few breaking changes between a few versions but usually this library can be used across many different versions of spring-boot, spring-cloud and grpc.

ST-DDT avatar Jan 09 '22 10:01 ST-DDT