-
Notifications
You must be signed in to change notification settings - Fork 706
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 service tags in ServiceInstance #19
Comments
@avthart pull requests are welcome. This will be tricky as different implementations might or might not have support tags. Fits well with consul :-) X-ref spring-cloud/spring-cloud-consul#19 |
Since there is a published Java 7 API, and because tags are (at least currently) not relevant to Eureka service discovery, it's probably a good idea to explore design options before any contributor goes off half-cocked only to have his approach rejected. One straightforward-seeming approach is to create a It is still desirable to model the "tagged" (or any optional/additional) behavior in an interface, but I don't think it's particularly important to have
Unfortunately I can't see what to do further that wouldn't require * or equivalent calls on |
Since we control the api there's no reason to use |
By "since we control the api" do you mean to say that it is kosher to add methods to a public interface within spring-cloud? As for your API suggestions,
Where each member of |
@spencergibb: Fleshing out the scalable |
That looks good enough for pull requests. |
@mbenson Should Capability be represented as an enum? Doesn't that tie the underlying discovery implementations (consul, eureka etc) to the available types in that enum? If Consul wanted to add more capabilities, the implementor would have to then update spring-cloud-commons first before proceeding. |
I think it's nice to make concepts available in some typesafe manner. I originally thought about declaring a marker |
In my view, using a marker interface decouples the underlying capability implementations from this parent library. With an enum, spring-cloud-commons would need to change every time one of the underlying service discovery implementations wants to add a new capability.
Wouldn't it be up the the underlying implementation to provide that type safety? Users know whether they are interacting with Consul, Eureka or whatever the underlying service discovery framework is |
What happens when multiple |
If you're going to use something specific to the |
They would both have a similar capability, I would imagine. I'd say the duplication is a trade-off but I'm not in the best position to weigh those merits
Fair point. In my case, there are other features in spring-cloud-consul that make it worthwhile to use. All that said, it seems like you've thought this through already and are comfortable with your decision. Thanks for talking me through it. |
Well, when all is said and done, I'm just part of the peanut gallery. @spencergibb any thoughts on where the whole issue stands? |
@mbenson sorry for the delay in responding. I can see spring-cloud/spring-cloud-consul#48 working without the abstraction here in commons. If you want to search by tags, cast to ConsulDiscoveryClient and be on your way. |
Upgrade github-pages gem to fix deprecation warnings
Tags are a list of values that can be used to distinguish between "master" or "slave" nodes, different versions, management port, or any other service level labels.
Are there already any plans to support this or can I help?
The text was updated successfully, but these errors were encountered: