nacos icon indicating copy to clipboard operation
nacos copied to clipboard

naming service: subscribe a service and get the changed instance

Open Li-JH opened this issue 5 years ago • 6 comments

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

Li-JH avatar Jul 09 '19 11:07 Li-JH

Can you briefly explain why you need this feature?

nkorange avatar Jul 11 '19 08:07 nkorange

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.

Li-JH avatar Jul 11 '19 09:07 Li-JH

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.

nkorange avatar Sep 06 '19 03:09 nkorange

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.

ggzggzggz avatar Oct 09 '19 04:10 ggzggzggz

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?

huangxinze avatar Feb 22 '24 10:02 huangxinze

Will be solved with #10374

KomachiSion avatar Apr 15 '24 08:04 KomachiSion