question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support separate consul discovery properties for grpc and http services

See original GitHub issue

Hello! Starting from some version now grpc automatically registers itself on consul. I have TWO registrations now: <service name> and grpc-<service name> both with same set of tags. There is no way I can separate those two by tags or keep only <service name>. The only way is to filter by service name prefix grpc-, which is a very bad practice (what if I want to name my service grpc-something?). Currently I have to use awkward spring.autoconfigure.exclude (which doesn’t concat automatically if specified in several profiles, see https://stackoverflow.com/questions/41170316/combine-list-from-multiple-spring-boot-yaml-files). Here are few suggestions I have:

  1. Add a separate setting for enabling grpc consul (and probably other servers) registration. See OnConsulRegistrationEnabledCondition which requires both spring.cloud.service-registry.enabled and spring.cloud.consul.service-registry.enabled flags. We can disable all auto registration or only consul auto registration this way. For grpc you might wanna check both spring.cloud.service-registry.enabled and spring.cloud.grpc.discovery.service-registry.enabled
  2. Add grpc service registration tags which override spring.cloud.consul.discovery.tags when applied to grpc service registration like spring.cloud.grpc.discovery.tags
  3. Extract grpc- hardcode into config to something like spring.cloud.grpc.discovery.service-prefix

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jvmletcommented, Oct 10, 2021

@OverDrone , FYI, see #251 , 4.5.8-SNAPSHOT should be published in few minutes

1reaction
OverDronecommented, Oct 10, 2021

Yes, that should do it for me, thx. I don’t require hotfix solution. I can live with spring.autoconfigure.exclude for some time. Take your time to build quality product 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Register Services with Service Definitions | Consul
Define and register services and their health checks with Consul to make a service available for service discovery or service mesh access.
Read more >
Spring Cloud Consul
Consul provides Service Discovery services via an HTTP API and DNS. ... property, management service will be registered as a separate service than...
Read more >
grpc-spring-boot-starter/README.adoc at master - GitHub
Contribute to LogNet/grpc-spring-boot-starter development by creating an account ... is to externalize the transactional logic into separate service class :.
Read more >
Configuring a gRPC service - Cloud Endpoints
To configure this in your service configuration, some parts of the service configuration, such as authentication and http , let you specify rules...
Read more >
Configuration | grpc-spring-boot-starter - GitHub Pages
The properties for the channels are all prefixed with grpc.client.__name__. and grpc.client. ... Example: discovery:///service-name; self (Prio 0):
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found