使用mq发消息时,消息体使用一个实体类接收,消息接收方反序列化时总是报错:
2019-10-10 13:29:34.609 [mro: e0ff3fbce8cfa095][http-nio-8002-exec-7] ERROR com.runlion.sat.tools.handler.ExceptionHandler - >>>>>>>>> 全局异常 JSON parse error: Can not deserialize instance of java.lang.Boolean out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.Boolean out of START_OBJECT token
at [Source: java.io.PushbackInputStream@27ba128; line: 1, column: 1] >>>>>>>>>>>>>>
1. 发送消息
//发送占用库存消息
OccupyTypeDTO occupyTypeDTO = new OccupyTypeDTO();
occupyTypeDTO.setId(sendOrderMainId);
occupyTypeDTO.setType(1);
occupyTypeDTO.setUserId(LoginUserUtil.getLoginUserId());
MqDTO mqDTO = new MqDTO();
mqDTO.setMqTypeEnum(OCCUPYSTRATEGY);
mqDTO.setData(JSONObject.toJSONString