请问老师这个发送后的回调函数在生产中有什么用呢?
来源:2-19 RabbitMQ与SpringBoot整合_消费端-2
Panda_io
2020-11-26 18:35:56
MessagePostProcessor mpp= new MessagePostProcessor() {
//这是消息发送完成的回调函数
@Override
public org.springframework.amqp.core.Message postProcessMessage(org.springframework.amqp.core.Message message) throws AmqpException {
System.err.println("---> post to do: " + message);
return message;
}
};
1回答
一般来讲做一些后置的处理鸭,比如发完消息后,确定OK,那么就去做一些日志记录等等,或者有的业务去做一些逻辑后置化操作,比如积分后,通知提醒
相似问题