nacos
nacos copied to clipboard
naming service: subscribe a service and get the changed instance
Issue Description
feature request
Describe what happened (or what feature you want)
when subscribing a service, all instances will be acquired once any instance changed. in most cases, the changed one rather than all the instances is just what we want.
Describe what you expected to happen
hope to provide api that can get the changed instance
Can you briefly explain why you need this feature?
In such a case that i would like to deal with the changed instance when the service is subscribed rather than all instances are returned among which i cannot distinguish the changed one. The creation or the deletion of instances under certain service will trigger the following actions according the changed instance infomation. This is mostly used in data management, not service discovery. And I guess when we come to the concept: subscribe, we not only want to know the fact that the service has really changed but also which part has changed. This usage maybe rare in nacos, but this feature can be helpful to developers who need it.
This requires an incremental push of Nacos, currently it's not easy to implement.
But we consider this feature valuable and may implement it in some future version.
I think you can save the service's checksum for next subscribe request, and if the checksum has not changed, the Nacos's server can return the status to tell the client.
I also encountered the same problem, registering a service instance, and all instances under this listening service object will be pushed down, resulting in a much larger message packet!!! Do you have any solutions for this now?
Will be solved with #10374