{"action":"opened","issue":{"url":"https://api.github.com/repos/alibaba/nacos/issues/18","repository_url":"https://api.github.com/repos/alibaba/nacos","labels_url":"https://api.github.com/repos/alibaba/nacos/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/nacos/issues/18/comments","events_url":"https://api.github.com/repos/alibaba/nacos/issues/18/events","html_url":"https://github.com/alibaba/nacos/issues/18","id":345684876,"node_id":"MDU6SXNzdWUzNDU2ODQ4NzY=","number":18,"title":"Only one instance returned when invoke getAllInstance method","user":{"login":"jasonsuzhou","id":5878409,"node_id":"MDQ6VXNlcjU4Nzg0MDk=","avatar_url":"https://avatars3.githubusercontent.com/u/5878409?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonsuzhou","html_url":"https://github.com/jasonsuzhou","followers_url":"https://api.github.com/users/jasonsuzhou/followers","following_url":"https://api.github.com/users/jasonsuzhou/following{/other_user}","gists_url":"https://api.github.com/users/jasonsuzhou/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonsuzhou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonsuzhou/subscriptions","organizations_url":"https://api.github.com/users/jasonsuzhou/orgs","repos_url":"https://api.github.com/users/jasonsuzhou/repos","events_url":"https://api.github.com/users/jasonsuzhou/events{/privacy}","received_events_url":"https://api.github.com/users/jasonsuzhou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-30T09:43:07Z","updated_at":"2018-07-30T09:43:07Z","closed_at":null,"author_association":"NONE","body":"Test the nacos client:\r\nI register 2 instances with same service name, IP but different port number.\r\ne.g. \r\ncom.mh.nacos010.helloWorldService 127.0.0.1 80\r\ncom.mh.nacos010.helloWorldService 127.0.0.1 81\r\n\r\nAfter invoke registerInstance method, I checked the server side, the instance list have been written to \r\ncom.alibaba.nacos.naming.iplist.com.mh.nacos010.helloWorldService\r\nLater I invoke the getAllInstanceMethod, but only one instance returned:\r\ncode sample:\r\n```java\r\nString serverAddr = \"127.0.0.1:8080\";\r\n\t\tString serviceName = \"com.mh.nacos010.helloWorldService\";\r\n\t\tNamingService naming = NamingFactory.createNamingService(serverAddr);\r\n\t\tList<Instance> list = naming.getAllInstances(serviceName);\r\n\t\tif (list != null && !list.isEmpty()) {\r\n\t\t\tfor (Instance ins : list) {\r\n\t\t\t\tSystem.out.println(ins.getInstanceId());\r\n\t\t\t\tSystem.out.println(ins.getIp());\r\n\t\t\t\tSystem.out.println(ins.getPort());\r\n\t\t\t\tSystem.out.println(ins.getWeight());\r\n\t\t\t\tSystem.out.println(ins.getClass());\r\n\t\t\t\tSystem.out.println(ins.isHealthy());\r\n\t\t\t}\r\n\t\t}\r\n```\r\nreturn sample:\r\n```\r\n127.0.0.1-80-DEFAULT-com.mh.nacos010.helloWorldService\r\n127.0.0.1\r\n80\r\n2.0\r\nclass com.alibaba.nacos.api.naming.pojo.Instance\r\ntrue\r\n```\r\nOnly port number with 80 was returned.\r\n\r\nMy question:\r\nIs nacos server already have load balance to provide only one available instance to client?"}}
{"actor":{"display_login":"jasonsuzhou"}}