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 108
108
mvn test
109
109
110
110
## 使用样例
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
+ ```
111
124
112
125
### 推送样例
113
126
122
135
try {
123
136
PushResult result = jpushClient. sendPush(payload);
124
137
LOG . info(" Got result - " + result);
125
-
138
+
126
139
} catch (APIConnectionException e) {
127
140
// Connection error, should retry later
128
141
LOG . error(" Connection error, should retry later" , e);
You can’t perform that action at this time.
0 commit comments