File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 108108 mvn test
109109
110110## 使用样例
111+ 如果使用 NettyHttpClient(v3.2.15 版本新增),需要在响应返回后手动调用一下 NettyHttpClient 中的 close 方法,否则进程不会退出。代码示例:
112+ ```
113+ ...
114+ try {
115+ PushResult result = jpushClient.sendPush(payload);
116+ LOG.info("Got result - " + result);
117+ Thread.sleep(5000);
118+ // 定义一个 close 方法,最终调用 NettyHttpClient 中的 close 方法即可。
119+ jpushClient.close();
120+ } catch(InterruptedException e) {
121+ e.printStackTrace();
122+ }
123+ ```
111124
112125### 推送样例
113126
122135 try {
123136 PushResult result = jpushClient. sendPush(payload);
124137 LOG . info(" Got result - " + result);
125-
138+
126139 } catch (APIConnectionException e) {
127140 // Connection error, should retry later
128141 LOG . error(" Connection error, should retry later" , e);
You can’t perform that action at this time.
0 commit comments