正在显示
1 个修改的文件
包含
32 行增加
和
15 行删除
| @@ -58,24 +58,41 @@ public class Custom_Response_Processor { | @@ -58,24 +58,41 @@ public class Custom_Response_Processor { | ||
| 58 | 58 | ||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | + /** | ||
| 62 | + * 通过总线消费服务获取回执数据 | ||
| 63 | + */ | ||
| 61 | public void analysis(){ | 64 | public void analysis(){ |
| 62 | - ResultJson<List<String>> listResultJson = kafkaReciveApi.recive(USER_NAME); | ||
| 63 | - log.info("2-获取结果为:{},数量为:{}",listResultJson.toString(),listResultJson.getData().size()); | ||
| 64 | - if ("200".equals(listResultJson.getCode()) && listResultJson.getData()!=null && listResultJson.getData().size()>0){ | ||
| 65 | - log.info("3-开始处理获取数据"); | ||
| 66 | - List<String> dataList = listResultJson.getData(); | ||
| 67 | - for (int i = 0; i <dataList.size() ; i++) { | ||
| 68 | - String msg = dataList.get(i); | ||
| 69 | - try{ | ||
| 70 | - analysisMessage(msg,i); | ||
| 71 | - }catch (Exception e){ | ||
| 72 | - log.error("[Analysis-ERR]!!!{}报文内容解析异常:{},开始处理下一条消息!!!",msg,e.toString()); | ||
| 73 | - e.printStackTrace(); | ||
| 74 | - } | 65 | + try { |
| 66 | + ResultJson<List<String>> listResultJson = kafkaReciveApi.recive(USER_NAME); | ||
| 67 | + log.info("2-获取结果为:{},数量为:{}",listResultJson.toString(),listResultJson.getData().size()); | ||
| 68 | + if ("200".equals(listResultJson.getCode()) && listResultJson.getData()!=null && !listResultJson.getData().isEmpty()){ | ||
| 69 | + responseResolve(listResultJson); | ||
| 70 | + }else { | ||
| 71 | + log.info("[CONSUMER-RESULT] - 未获取到消息,code:{},msg:{},data:{}",listResultJson.getCode(),listResultJson.getMsg(),listResultJson.getData()); | ||
| 72 | + } | ||
| 73 | + } catch (Exception e) { | ||
| 74 | + log.error("[CONSUMER-ERR]!!!获取消息异常,开始获取下一条消息!!!->{}",e.toString()); | ||
| 75 | + e.printStackTrace(); | ||
| 76 | + } | ||
| 77 | + } | ||
| 75 | 78 | ||
| 79 | + /** | ||
| 80 | + * 处理接收到的总线数据 | ||
| 81 | + * @param listResultJson | ||
| 82 | + */ | ||
| 83 | + public void responseResolve(ResultJson<List<String>> listResultJson){ | ||
| 84 | + log.info("3-开始处理获取数据"); | ||
| 85 | + List<String> dataList = listResultJson.getData(); | ||
| 86 | + for (int i = 0; i <dataList.size() ; i++) { | ||
| 87 | + String msg = dataList.get(i); | ||
| 88 | + try{ | ||
| 89 | + log.info("3.1-开始解析数据-[{}]",msg); | ||
| 90 | + analysisMessage(msg,i); | ||
| 91 | + }catch (Exception e){ | ||
| 92 | + log.error("[Resolve-ERR]!!!{}报文内容解析异常:{},开始处理下一条消息!!!",msg,e.toString()); | ||
| 93 | + e.printStackTrace(); | ||
| 76 | } | 94 | } |
| 77 | - }else { | ||
| 78 | - log.info("[CONSUMER-RESULT] - 未获取到消息"); | 95 | + |
| 79 | } | 96 | } |
| 80 | } | 97 | } |
| 81 | 98 |
-
请 注册 或 登录 后发表评论