日志回调服务

This commit is contained in:
xueli.xue 2016-05-28 20:16:05 +08:00
parent 87060f426c
commit 3420b1bd48
1 changed files with 16 additions and 13 deletions

View File

@ -204,21 +204,24 @@ public class HandlerRepository {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
try { while(true){
HashMap<String, String> item = callBackQueue.poll(); try {
if (item != null) { HashMap<String, String> item = callBackQueue.poll();
RemoteCallBack callback = null; if (item != null) {
try { RemoteCallBack callback = null;
callback = HttpUtil.post(item.get("_address"), item); try {
} catch (Exception e) { callback = HttpUtil.post(item.get("_address"), item);
logger.info("HandlerThread Exception:", e); } catch (Exception e) {
} logger.info("HandlerThread Exception:", e);
logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback}); }
} logger.info(">>>>>>>>>>> xxl-job callback , params:{}, result:{}", new Object[]{item, callback});
} catch (Exception e) { }
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
}); }).start();
} }
public static void pushCallBack(String address, HashMap<String, String> params){ public static void pushCallBack(String address, HashMap<String, String> params){
params.put("_address", address); params.put("_address", address);