问答详情
源自:2-4 RabbitMQ整合SpringBoot2-消费端处理消息-2

启动消费者时RabbitListener报错

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肯定是空啊,不知道怎么解决

提问者:HandsonAlex 2018-09-06 15:45

个回答

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

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