使用JaxRsClientFactory创建代理时,如何设置连接池大小/最大连接数?

我正在使用JaxRSClientFactory为我的API创建代理客户端。代码如下:

    final MyApi api = JAXRSClientFactory.create(url,MyApi.class,Collections.singletonList(new JacksonJaxbJsonProvider(new ObjectMapper(),new Annotations[] {Annotations.JACKSON})) )
    ;

    WebClient.client( api ).header( "Authorization",auth ).header("User-Agent","MyService");
    WebClient.getconfig( api ).getHttpConduit().getclient().setReceiveTimeout( readTimeout );
    WebClient.getconfig( api ).getHttpConduit().getclient().setConnectionTimeout(connectTimeout);
    WebClient.getconfig( api ).getHttpConduit().getclient().setConnection( ConnectionType.KEEP_ALIVE);
    WebClient.client( api ).accept( MediaType.APPLICATION_JSON_TYPE );
    WebClient.client( api ).type( MediaType.APPLICATION_JSON_TYPE );

如何设置连接池大小或此处允许的最大连接数?我在线上找到了泽西岛RestEasyClient的示例,但没有找到用Client构造的JAXRSClientFactory的示例。

有人对此有任何想法吗?

wp_zhang2002 回答:使用JaxRsClientFactory创建代理时,如何设置连接池大小/最大连接数?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3015564.html

大家都在问