nacos icon indicating copy to clipboard operation
nacos copied to clipboard

nacos client config api refactor

Open shiyiyue1102 opened this issue 4 months ago • 0 comments

Is your feature request related to a problem? Please describe.

  1. publish config for cas should calculate expect config md5, but a encryped config can't be accquired by getConfig, cas publish is not avalivable for encrytped config.
  2. nacos client has serval publish config override method,when we need add a parameter, we need create a new one, not frendly for extension.
  3. current publish config method only return true or false, client can't get detailed fail reason,such as 403,503 or cas fail etc. we should provide more detailed result from client and the same goes for get config method.
  4. some users may invoke get config method to business request logic which may result in get config request storm to add pressure to server side, we need to design a meconism to avoid this scene.

Describe the solution you'd like 1.create new method like GetConfigResult getConfig(GetConfigRequest request), PublishConfigResult publishConfig(PublishConfigRequest request),RemoveConfigResult removeConfig(RemoveConfigRequest request) for extensionality. 2.use this two new methods to refactor current serval override method 3.GetConfigResult should return casMd5 for PublishConfigRequet#setCasMd5 to encryped config cas publish. 4. getConfig may get local content and md5 in CacheData or local snapshot dir, add a localMd5 to get config request, and compare client side md5 to server local matched md5 on server side , return 304 when equals, so server may not read content from disk and not return content to response to reduce cpu and io.

shiyiyue1102 avatar Oct 14 '24 10:10 shiyiyue1102