集成新版SECS/GEM

This commit is contained in:
caixiang 2022-11-17 09:42:31 +08:00
parent 435c57034e
commit d6b7d8eabc
2 changed files with 19 additions and 3 deletions

View File

@ -62,12 +62,27 @@ public class PID10_1Received{
String transactionId = mqMessage.getHeader().getTransactionId(); String transactionId = mqMessage.getHeader().getTransactionId();
System.out.println("收到的消息是: "+mqMessage.toString()); System.out.println("收到的消息是: "+mqMessage.toString());
System.out.println(); System.out.println();
logger.info(mqMessage.toString());
//todo reply //todo reply
reply(mqMessage); reply(mqMessage);
// //回调给MES --- 开始
// //1. 正常情况
// String integer= HttpUtil.post(Constant.mesCallBackUrl,JSONObject.toJSONString(mqMessage));
// Integer result = Integer.valueOf(integer);
//
// //注意 这里特别注意 已经拒收的消息 再签收是要出错的这里要特别注意
// if(result == 1){
// logger.info("在 EAP_REQUEST_QUEUE_PID4B 队列中,transitionId"+transactionId+", 这条消息处理成功");
// channel.basicAck(deliveryTag,false);
// }else {
// logger.error("在 EAP_REQUEST_QUEUE_PID4B 队列中,transitionId"+transactionId+" 处理消息的时候 出现异常,然后 拒签消息 ,然后丢到死信队列");
// channel.basicNack(deliveryTag,false,false);
// }
// //回调给MES --- 结束
channel.basicAck(deliveryTag,false); channel.basicAck(deliveryTag,false);
System.out.println(mqMessage.toString());
}catch (Exception e){ }catch (Exception e){
// 第一个false 不批量签收第二个false 不重回队列 // 第一个false 不批量签收第二个false 不重回队列
logger.error(e.getMessage()); logger.error(e.getMessage());
@ -91,7 +106,7 @@ public class PID10_1Received{
response.setReturns(aReturn); response.setReturns(aReturn);
rabbitSender.sendDirect(response,ConfigOfPID10_1.EXCHANGE_NAME_PID10_1,ConfigOfPID10_1.EAP_RESPONSE_QUEUE_ROUTINGKEY_PID10_1); rabbitSender.sendDirect(response,ConfigOfPID10_1.EXCHANGE_NAME_PID10_1,ConfigOfPID10_1.EAP_RESPONSE_QUEUE_ROUTINGKEY_PID10_1);
System.out.println("reply: "+response.toString()); System.out.println("回复的消息是: "+response.toString());
} }

View File

@ -20,6 +20,7 @@ public class MQMessage {
private Header header; private Header header;
@JSONField(jsonDirect = true) @JSONField(jsonDirect = true)
private String body; private String body;
//在序列化和反序列化 的时候 都会把 json 里面的return字段转成 object 里面的returns字段
@JSONField(name = "return") @JSONField(name = "return")
private Returns returns; private Returns returns;