@RabbitListener(queues = {MQMConstant.SYS_TOPIC_LOGIN_MESSAGE,})
public void processLoginMassage(String message) {
System.out.print("路由键:"+MQMConstant.SYS_TOPIC_LOGIN_MESSAGE);
System.out.print("processLoginMassage接收到消息:"+message);
Map map = new HashMap();
MessageProperties
//#{userId},#{freezeID},#{pwd},#{balance},#{state},#{memo}
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
map.put("userId",sdf.format(new Date())+(100000+(int)(Math.random()*900000)));
map.put("freezeID","465884422");
map.put("pwd","1234567890");
map.put("balance","12");
map.put("state",100);
map.put("memo",message);
busiOrderFeeMapper.insertMoney(map);
}
先创建一个类似HibernateCallBack的接口,然后处理完成回调方法