NutzCN Logo
问答 ZbusClientBean的createHttpClientBootstrap方法中的serverAddress为啥没有用到啊?
发布于 754天前 作者 wx_76f0hm3q2j4f0728cur9 1411 次浏览 复制 上一个帖子 下一个帖子
标签:
@IocBean(
        name = "zbusHttpClientBootstrap",
        depose = "close"
    )
    public ClientBootstrap createHttpClientBootstrap() {
        ClientBootstrap bootstrap = new ClientBootstrap();
        ServerAddress serverAddress = new ServerAddress();
        if (this.conf.has("zbus.rpc.client.serviceToken")) {
            bootstrap.serviceToken(this.conf.get("zbus.rpc.client.serviceToken"));
            serverAddress.token = this.conf.get("zbus.rpc.client.serviceToken");
        }

        if (this.conf.has("zbus.rpc.client.clientPoolSize")) {
            bootstrap.clientPoolSize(this.conf.getInt("zbus.rpc.client.clientPoolSize"));
        }

        this.conf.has("zbus.rpc.client.serviceName");
        if (this.conf.has("zbus.rpc.client.serverAddress")) {
            serverAddress.address = this.conf.get("zbus.rpc.client.serverAddress");
        }

        if (this.conf.has("zbus.rpc.client.sslEnabled")) {
            serverAddress.sslEnabled = this.conf.getBoolean("zbus.rpc.client.sslEnabled");
        }

        if (this.conf.has("zbus.rpc.client.certificate")) {
            serverAddress.certificate = this.conf.get("zbus.rpc.client.certificate");
        }

        return bootstrap;
    }
3 回复
        if (this.conf.has("zbus.rpc.client.certificate")) {
            serverAddress.certificate = this.conf.get("zbus.rpc.client.certificate");
        }

        bootstrap.serviceAddress(serverAddress); // 测试了以下,源码加上这行zbus的http模式就可以用了
        return bootstrap;
添加回复
请先登陆
回到顶部