// 传入主控地址,在 db_tars  t_registry_info 表中
        Communicator communicator = CommunicatorFactory.getInstance()
                .getCommunicator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.4 -p 17890");
        // 这里不需要绑定 ip 和端口
        GlobalIdPrx proxy = communicator.stringToProxy(GlobalIdPrx.class, "ICTPAAS.GIDServer.GlobalIdObj");

        String globalId = proxy.getGlobalId("testw");

主控会拉取当前可用的服务来负载均衡,默认是轮询

相关文章:

  • 2021-11-17
猜你喜欢
  • 2021-06-11
  • 2022-02-19
  • 2022-02-09
  • 2021-07-09
  • 2021-12-21
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案