spring-cloud-consul icon indicating copy to clipboard operation
spring-cloud-consul copied to clipboard

Support service discovery list backup. (#751)

Open chenzhiguo opened this issue 4 years ago • 3 comments

Cache the service list data, if the Consul cluster is not available, use cache data to ensure that the service is highly available.

chenzhiguo avatar Sep 09 '21 07:09 chenzhiguo

Can you describe the use case here? Both spring cloud loadbalancer and ribbon have caches for loadbalancing. If we decide to do this we should be consistent with s-c-lb https://github.com/spring-cloud/spring-cloud-commons/tree/main/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/cache

spencergibb avatar Sep 10 '21 18:09 spencergibb

@spencergibb I found that the cache in the load balancer will be lost after a certain period of time. This is not the same as the purpose of my PR. Of course, we can modify the the load balancer cache to achieve the same purpose. I don't quite clear what other help do I do?

chenzhiguo avatar Sep 11 '21 13:09 chenzhiguo

Oh...Is there anything unsuitable?

chenzhiguo avatar Nov 01 '21 03:11 chenzhiguo

If the loadbalancer cache looses information, that should be fixed. I've marked #751 for discussion.

spencergibb avatar Mar 08 '23 22:03 spencergibb

You can change the TTL of the cache to something very large here https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#loadbalancer-cache-configuration

Otherwise, if you think there is a bug in spring cloud loadbalancer, open an issue in https://github.com/spring-cloud/spring-cloud-commons/issues

spencergibb avatar Mar 09 '23 18:03 spencergibb