-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support separate consul discovery properties for grpc and http services #250
Comments
@OverDrone , where did |
Yes, sorry, I meant
Yes, I have |
And your intention is to discover web services (excluding grpc services) by tags only ? Don't you discovery by service id ? |
In this case grpc service registered name for app named |
I use nginx consul template which reads info from consul and builds nginx config. Process rely on tags to determine whether to include this service in route, what url suffix to use etc. But generally that doesn't matter much. Generally I see no reason keeping 2 registrations on consul for the same app instance. Also this way consul would call health checks twice for the same instance. Ofcause I can't say that my usecase is valid for all users out there, I've seen your configuration where for each GRPC service you create separate registration on consul. But at least give an option to control this. |
yes, and some logic that depends on service name prefix would see 2 services instead of 1: |
The health check is performed on service instance, not on app instance. I can imagine the situation where single app instance provides several services instances - some of them can become unhealthy and the rest services remain healthy. And its up to you to decide how to check health (globally or per service). Moreover , if you serve both But I do understand the need to distinguish services at least by tag and the requirements to provide different set of tags for Later, I'll also provide configuration for |
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 :) |
@OverDrone , FYI, see #251 , |
Hello!
Starting from some version now grpc automatically registers itself on consul. I have TWO registrations now:
<service name>
andgrpc-<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 prefixgrpc-
, which is a very bad practice (what if I want to name my servicegrpc-something
?). Currently I have to use awkwardspring.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:
OnConsulRegistrationEnabledCondition
which requires bothspring.cloud.service-registry.enabled
andspring.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 bothspring.cloud.service-registry.enabled
andspring.cloud.grpc.discovery.service-registry.enabled
spring.cloud.consul.discovery.tags
when applied to grpc service registration likespring.cloud.grpc.discovery.tags
grpc-
hardcode into config to something likespring.cloud.grpc.discovery.service-prefix
The text was updated successfully, but these errors were encountered: