解决RabbitMQ发送数据为空字符串

来源:互联网 发布:java中的getclass方法 编辑:程序博客网 时间:2024/06/05 18:32

import org.springframework.amqp.core.AmqpTemplate;

错误的发送方式
fireTemplate.convertAndSend(fireCRTEvent)

fireTemplate.convertAndSend(JSON.toJSONString(fireCRTEvent));
或者自己重写toString方法
fireTemplate.convertAndSend(fireCRTEvent.toString());

0 0
原创粉丝点击