1.注意点, 发送的消息实体要实现 Serializable 接口

2.在rabbitmq可视化界面中,如果队列queue绑定了exchange,不要直接在queue里粘贴消息, 要在绑定的exchange下,通过routting key (路由到要发送的queue) 粘贴发送消息。

很不幸,我在这里栽到了...

简单的记录下,留着回忆。

// 代码角度 封装的消息实体类要实现Serializable 接口public class EquNameplateSynDTO implements Serializable {// 省略getter、setterprivate String equId;private String commonEquId;private String picUrl;}

单元测试封装的消息如下

{"obj":{"commonEquId":"328","picUrl":"https://hais-prod.oss-cn-shenzhen.aliyuncs.com/hospital/HS000665/equ/5d9063fa-f17d-40a2-8ab9-076089bfd7eb/711187157686676231.jpg"},"msgId":"328","action":"ADD","type":"COMMON_EQU_NAMEPLATE_PIC"}

贴到rabbit 客户端中, 程序开始疯狂报错 " Execution of Rabbit message listener failed ", 无奈只能删除queue,再次像下图中粘贴消息,还是会报同样的错误。

操作如下 直接在Queue中粘贴了消息

Caused by: org.springframework.messaging.MessageDeliveryException: No channel resolved by router 'router' and no 'defaultOutputChannel' defined.at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:198)at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:162)at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:132)at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:105)at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:73)at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:453)at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:401)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47)at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:431)at org.springframework.integration.handler.AbstractMessageProducingHandler.doProduceOutput(AbstractMessageProducingHandler.java:284)at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:265)at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:223)at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:129)at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:162)at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:132)at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:105)at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:73)at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:453)at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:401)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166)at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47)at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:205)at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.access$600(AmqpInboundChannelAdapter.java:57)at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.createAndSend(AmqpInboundChannelAdapter.java:238)at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.onMessage(AmqpInboundChannelAdapter.java:204)at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1552)... 10 common frames omitted
2020-12-24 11:56:58 [container-4] WARN  o.s.a.r.listener.ConditionalRejectingErrorHandler - Execution of Rabbit message listener failed.
org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception

解决:找到并在绑定的exchange中 通过rotuing key 粘贴发送消息, (Properties中添加 content_type   text/plain ,试了不加也可以。)

RabbitMq报错 Execution of Rabbit message listener failed相关推荐

  1. RabbitMQ报错(2)——Message:Already closed: The AMQP operation was interrupted: AMQP close-reason, initia

    原因:队列服务端重启后,队列发布端断开了接口,无法再次发送消息 解决:发送端设置断开连接后自动启动属性,默认为断开后每隔五秒钟重试连接 var factory = new ConnectionFact ...

  2. Tomcat 8报错 SEVERE: One or more listener failed to start,如何找到更详细的错误信息

    有时在tomcat的应用启动的时候会出现这样的错误: 16-Oct-2016 19:04:10.216 INFO [main] org.apache.catalina.startup.Catalina ...

  3. linux 启动rabbitmq 报错:

    linux 启动rabbitmq 报错: Job for rabbitmq-server.service failed because the control process exited with ...

  4. rabbitmq报错:Listener method could not be invoked with the incoming message

    rabbitmq报错:Listener method could not be invoked with the incoming message 错误翻译:无法使用传入消息调用监听器方法 一个top ...

  5. Windows下安装RabbitMQ报错:unable to perform an operation on node时的解决方案

    Windows下安装RabbitMQ报错:unable to perform an operation on node时的解决方案 参考文章: (1)Windows下安装RabbitMQ报错:unab ...

  6. hive报错Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

    hive出现报错 Error: Error while processing statement: FAILED: Execution Error, return code 2 from org.ap ...

  7. 安装rabbitMq报错:error: unpacking of archive failed on file /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.9

    安装rabbitMq报错: 错误提示:error: unpagacking of archive failed on file /usr/lib/rabbitmq/lib/rabbitmq_serve ...

  8. Maven - 编译报错Execution repackage of goal spring-boot-maven-plugin;Unable to find main class

    Maven - 编译报错Execution repackage of goal spring-boot-maven-plugin;Unable to find main class 一. common ...

  9. Rabbitmq报错pika.exceptions.IncompatibleProtocolError: StreamLostError: ('Transport indicated EOF',)

    rabbitmq 报错 pika.exceptions.IncompatibleProtocolError: StreamLostError: ('Transport indicated EOF',) ...

  10. 高德地图H5 定位失败报错 geolocation time out. Get ipLocation failed解决方案

    高德地图H5 定位失败报错 geolocation time out. Get ipLocation failed的解决方法. 前言:此坑踩得我挺难受的,搞了三天 需求:进入页面,获取用户具体经纬度并 ...

最新文章

  1. php数组如何写入txt文件中_php将数组写入到文件的三种方法
  2. sap crm行业解决方案_SAP云平台和第三方CRM解决方案(火锅)互联
  3. 分隔线演练-利用参数增加分隔线的灵活度
  4. python 插值_Python求解插值、拟合和微分方程问题
  5. 一日一技:在Ocelot网关中统一配置Swagger
  6. nginx: [error] open() “/usr/local/var/run/nginx.pid“ failed (2: No such file or directory)
  7. html页面导出,HTML页面导出execl表格
  8. idea jdbc封装_真赞!IDEA 中这么玩 MyBatis,让编码速度飞起!
  9. 【PL/SQL】学习笔记 (10)例外之 too_many_rows
  10. 6寸照片的尺寸是多少_各类证件照标准尺寸大全
  11. iOS应用开发应遵循的10条设计原则
  12. 感受MapXtreme2004之二
  13. SQL Server 2005各版本区别
  14. 好用的 edge 插件有哪些?
  15. 人脸识别demo分析(opencv版本)
  16. 计算机学院运动会海报,《图文》运动会宣传海报资料
  17. TCP/IP五层模型
  18. Centos 7 安装Redis
  19. F - Ubiquitous Religions
  20. c语言实现的学生信息查询系统

热门文章

  1. 使用jib-maven-plugin分层构建Docker镜像——避免直接使用FatJar
  2. shuipFCMS二次开发记录一
  3. QCon-小布助手对话系统工程实践
  4. Android Verified Boot 2.0简要
  5. 撂荒耕地变“希望良田” 国稻种芯:平远县热柘镇以企带村
  6. 苏炳添博士论文研究自己,奥运学术两兼顾
  7. justinmind破解方法
  8. 数据库小型教务系统,成绩管理系统
  9. codeup21158 循环比赛日程表
  10. solidworks齿轮编辑_如何应用solidworks进行齿轮工程图绘制