启动消费者时RabbitListener报错

来源:2-4 RabbitMQ整合SpringBoot2-消费端处理消息-2

HandsonAlex

2018-09-06 15:45

2018-09-06 15:41:15.867  WARN 13880 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed.


org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method could not be invoked with the incoming message

Endpoint handler details:

Method [public void com.ecdata.core.rabbitMQ.TopicReceiver.receiveMessage(com.ecdata.model.RabbitMQ.MQMessage,java.util.Map<java.lang.String, java.lang.Object>,com.rabbitmq.client.Channel)]

Bean [com.ecdata.core.rabbitMQ.TopicReceiver@308e465b]

Caused by: org.springframework.messaging.handler.annotation.support.MethodArgumentNotValidException: Could not resolve method parameter at index 0 in public void com.ecdata.core.rabbitMQ.TopicReceiver.receiveMessage(com.ecdata.model.RabbitMQ.MQMessage,java.util.Map<java.lang.String, java.lang.Object>,com.rabbitmq.client.Channel): 1 error(s): [Error in object 'message': codes []; arguments []; default message [Payload value must not be empty]]

这里说错误原因是Payload value must not be empty,但是启动消费者时payload肯定是空啊,不知道怎么解决

写回答 关注

1回答

  • 阿神
    2018-09-09 20:28:23
    已采纳

    消费端报错,出现问题的是你的接口有问题,消费者启动后没有消息的话并不会执行呀。可能是你之前有不比配格式的消息

RabbitMQ消息中间件极速入门与实战

入门RabbitMQ,并整合SpringBoot2.x,实现100%消息的可靠性投递!

42055 学习 · 143 问题

查看课程

相似问题