jiguang-java-client-common

更新日志

  • 新增 ApacheHttpClient
    使用了 Apache 提供的 HttpClient,支持高并发发送请求。测试性能比 NativeHttpClient 以及 NettyHttpClient 好。

用法

...
clientConfig.setConnectionRequestTimeout(5 * 1000);
clientConfig.setSocketTimeout(5 * 1000);
ApacheHttpClient httpClient = new ApacheHttpClient(authCode, proxy, clientConfig);
...

发送请求的方式和之前一样。JPushClient v3.2.17 之后可以设置使用哪个 HttpClient 来发送请求,具体可以参考文档。

Change Log

  • Add ApacheHttpClient
    Uses Apache's HttpClient, to support highly concurrent requests.

Usage

...
clientConfig.setConnectionRequestTimeout(5 * 1000);
clientConfig.setSocketTimeout(5 * 1000);
ApacheHttpClient httpClient = new ApacheHttpClient(authCode, proxy, clientConfig);
...

The way to send requests is the same to the others, you're able switch HttpCilent to send push requests in JPushClient which's version v3.2.17 or later. Please refer our document.