Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用Nacos作为dubbo注册中心时,服务列表不全 #1285

Open
2 tasks
muxue-wang opened this issue Sep 11, 2024 · 2 comments
Open
2 tasks

使用Nacos作为dubbo注册中心时,服务列表不全 #1285

muxue-wang opened this issue Sep 11, 2024 · 2 comments

Comments

@muxue-wang
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the REAMDE of this repository and believe that this is not a duplicate.

Environment

  • Dubbo Admin version: 3.0.6
  • Registry center detail (type and version): Nacos 2.0.3
  • Operating System version: windows
  • Java version: java 8

Steps to reproduce this issue

后台显示服务列表不全
image

问题出现在这个方法,这个返回值count错误,导致不会继续拉取下一页,入参PAGINATION_SIZE是多少,返回值count就是多少
org.apache.dubbo.admin.registry.mapping.impl.NacosServiceMapping#getAllServiceNames
org.apache.dubbo.registry.nacos.NacosNamingServiceWrapper#getServicesOfServer
image

image

@muxue-wang
Copy link
Author

Dubbo Admin version:0.6.0

@muxue-wang
Copy link
Author

muxue-wang commented Sep 11, 2024

这个分页错误,可以改成这样

    private Set<String> getAllServiceNames() throws NacosException {
        Set<String> serviceNames = new HashSet<>();
        int pageIndex = 1;
        ListView<String> listView;

        do {
            listView = namingService.getServicesOfServer(pageIndex++, PAGINATION_SIZE, Constants.DEFAULT_GROUP);
            serviceNames.addAll(listView.getData());
        } while (listView.getData().size() == PAGINATION_SIZE && !listView.getData().isEmpty());

        return serviceNames;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant