grpc-ecosystem / grpc-spring

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

A service registers multiple instances on consul through coding. Why can grpc only call the service configured in the configuration file. #1014

Open liq0221 opened 8 months ago

liq0221 commented 8 months ago

A service registers multiple instances on consul through coding. Why can grpc only call the service configured in the configuration file.

ST-DDT commented 8 months ago

I'm somewhat confused with your question. The service will use the address from the config file, that might be one or more hardcoded addresses or a dynamic address such as dns or a service discovery. See also here: https://grpc-ecosystem.github.io/grpc-spring/en/client/configuration.html#choosing-the-target Have a look at the discovery scheme.