feat: add support for multiple nacos instances and replace events library with shdict#12263
feat: add support for multiple nacos instances and replace events library with shdict#12263Revolyssup wants to merge 50 commits intoapache:masterfrom
Conversation
| if not curr_services_in_use[config.id] then | ||
| curr_services_in_use[config.id] = {} | ||
| end | ||
| for name in pairs(service_names) do |
There was a problem hiding this comment.
why not assign service_names to curr_services_in_use[config.id] directly?
for name in pairs(curr_services_in_use[config.id]) do
if not service_names[name] then
nacos_dict:delete(name)
end
end
curr_services_in_use[config.id] = service_names
| -- maximum waiting time: 5 seconds | ||
| local waiting_time = 5 | ||
| local step = 0.1 | ||
| local logged = false | ||
| while not value and waiting_time > 0 do | ||
| if not logged then | ||
| logged = true | ||
| end | ||
|
|
||
| if body and 'table' == type(body) then | ||
| local err | ||
| body, err = core.json.encode(body) | ||
| if not body then | ||
| return nil, 'invalid body : ' .. err | ||
| ngx.sleep(step) | ||
| waiting_time = waiting_time - step | ||
| value = nacos_dict:get(key) |
There was a problem hiding this comment.
@Revolyssup why no any changes for this? #12263 (comment), we already discuss to remove it?
| -- Now we use control plane to list the services | ||
| function _M.list_all_services() | ||
| return {} | ||
| end |
There was a problem hiding this comment.
what's this ? it's unused function, please remove it.
|
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions. |
|
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Description
discovery.nacosas an array of nacos instances each with unique ID.NOTE: The older way of configuring nacos is still supported and older data will be valid. The older configuration now gets converted internally to new configuration before being passed onto the logic therefore making this change backwards compatible. Meaning users can use the single-instance configuration as well as multi instance configuration.
Fixes #11252
Checklist