-
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
Allow updating a service registration metadata #204
Comments
It doesn't seem unreasonable to me. @spencergibb what do you think? |
It sounds reasonable, getting something that works across impls might prove tricky. |
@smcvb want to submit a PR? |
@ryanjbaxter sure thing! |
That seems OK. Just make sure you also update the implementations as well. |
…ceInstance Introduce putMetadata(String key, String value) and setMetadata(Map<String, String> metadata) to ServiceInstance, to be able to adjust the metadata field through the ServiceInstance api.
Implement putMetadata(String key, String value) and setMetadata(Map<String, String> metadata) in DefaultServiceInstance to comply with the interface adjustment. The setMetadata() will be somewhat lengthy as we are dealing with a final map.
Implement putMetadata(String key, String value) and setMetadata(Map<String, String> metadata) in SimpleServiceInstance.
@ryanjbaxter did you also mean for me to adjust the specific Spring Cloud |
@smcvb all of the implementations will need to be changed. |
Ok, I'll see what time I can free up to help with that � |
Reorder functions a little [spring-cloud#204]
Add empty default functionality for put and set metadata [spring-cloud#204]
-Set constructor parameters on one line -Add javadoc for 'instance' parameter [spring-cloud#204]
I don't really like |
@dsyer, not all impls have a simple map backing them (consul in particular). |
I guess that’s why I said “break in an informative way�. But if it can support the putValue method, I’d say it can support a mutable backing map. |
After looking at consul, There is no consistent way to update a registration in spring cloud. I'm now positive we don't want #209 and I might go so far to say that the contract of |
I think the issue is: support updating a registration, whether that is metadata or something else. Only certain registration systems could support this by default (eureka), others might need work (consul, zookeeper) by responding to an event when metadata has changed. |
@spencergibb, @dsyer, et all I was thinking more in the lines of auto-wiring a bean like what is possible in eureka:
If we replace ApplicationInfoManager for our interface in spring cloud common, then writing a simple wrapper that delegate to each provider will do the work. |
Why do you need another bean besides a configuration properties bean? |
@spencergibb a bean to programatically add or change those properties at runtime based on a set of conditions.
which is what people is using with Eureka, I want to have one in spring cloud commons that can delegate to ApplicationInfoManager when you have eureka client in the class path
Notice that in k8s this will change the service itself, and not the individual spring boot application instances (Pods). There is a considerable mismatch in that area between k8s and spring cloud. |
@salaboy We've talked about adding methods to the |
ServiceInstance.Metadata
@spencergibb I think that is starting to make sense to me. We can add it in the KubernetesServiceRegistry class as well, which is not used by kubernetes but it can add that functionality. As soon as we can do
Sounds good to me.. |
@salaboy I wouldn't create a |
* updating discovery and config modules, removing netflix modules to start simple * hacking some jackson dependencies as they were not working * update Discovery AutoConfiguration, still messy, more work needed here * getting configuration working with the service registry * removing profiles check document matcher that doesn't exist anymore * fixing configMaps example * improving readmes and removing arquillian due it requires undertow * re adding all netflix modules * re adding commented example modules * fixing minor naming issues and adding commented out modules
Would it be possible to have some form of
put()
orset()
function for theMap<String,String> metadata
in theServiceInstance
?I'd like to be able to not rely on a specific Spring Cloud implementation for adjusting the
metadata
(like through Eureka's properties, or the tags in Consul), but just use the api in spring-cloud-commons to update aServiceIntance
it'smetadata
.This could for example give the possibility for other frameworks to set framework-specific knowledge in the
ServiceInstance.metadata
field and not having to know anything of specific implementation. Thus, only needing thespring-cloud-commons
dependency.The text was updated successfully, but these errors were encountered: