Skip to content

Commit bea0048

Browse files
committed
git sensor grpc lb policy change
1 parent 6d7e538 commit bea0048

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

client/gitSensor/GitSensorClient.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ func NewGitSensorClient(logger *zap.SugaredLogger, config *ClientConfig) (*Clien
8181

8282
// CATEGORY=INFRA_SETUP
8383
type ClientConfig struct {
84-
Url string `env:"GIT_SENSOR_URL" envDefault:"127.0.0.1:7070" description:"git-sensor micro-service url "`
85-
Protocol string `env:"GIT_SENSOR_PROTOCOL" envDefault:"REST" description:"Protocol to connect with git-sensor micro-service"`
86-
Timeout int `env:"GIT_SENSOR_TIMEOUT" envDefault:"0" description:"Timeout for getting response from the git-sensor"` // in seconds
84+
Url string `env:"GIT_SENSOR_URL" envDefault:"127.0.0.1:7070" description:"git-sensor micro-service url "`
85+
Protocol string `env:"GIT_SENSOR_PROTOCOL" envDefault:"REST" description:"Protocol to connect with git-sensor micro-service"`
86+
Timeout int `env:"GIT_SENSOR_TIMEOUT" envDefault:"0" description:"Timeout for getting response from the git-sensor"` // in seconds
87+
ServiceConfig string `env:"GIT_SENSOR_SERVICE_CONFIG" envDefault:"{\"loadBalancingPolicy\":\"pick_first\"}" description:"git-sensor grpc service config"`
8788
}
8889

8990
func GetConfig() (*ClientConfig, error) {

client/gitSensor/GitSensorGrpcClient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (client *GrpcApiClientImpl) getConnection() (*grpc.ClientConn, error) {
9090
grpc.WithChainUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor, otelgrpc.UnaryClientInterceptor()),
9191
grpc.WithBlock(),
9292
grpc.WithTransportCredentials(insecure.NewCredentials()),
93-
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`),
93+
grpc.WithDefaultServiceConfig(client.config.ServiceConfig),
9494
)
9595
endpoint := fmt.Sprintf("dns:///%s", client.config.Url)
9696

0 commit comments

Comments
 (0)