rabbitTemplate.convertAndSend()这个方法的传参传错了,你检查一下就能解决问题了

举个例子把:

我这里使用的使用的是路由模式

第一个参数:你使用的交换机的名称,MQConstants.HOTEL_EXCHANGE
第二个参数:路由key值,MQConstants.HOTEL_INSERT_KEY,
第三个参数:你发送的内容, hotel.getId()
rabbitTemplate.convertAndSend(MQConstants.HOTEL_EXCHANGE, MQConstants.HOTEL_INSERT_KEY, hotel.getId());

工具类:MQConstants的参数

public class MQConstants {/*** 交换机*/public final static String HOTEL_EXCHANGE = "hotel.direct";/*** 监听新增和修改的队列*/public final static String HOTEL_INSERT_QUEUE = "hotel.insert.queue";/*** 监听删除的队列*/public final static String HOTEL_DELETE_QUEUE = "hotel.delete.queue";/*** 新增或修改的RoutingKey*/public final static String HOTEL_INSERT_KEY = "hotel.insert";/*** 删除的RoutingKey*/public final static String HOTEL_DELETE_KEY = "hotel.delete";
}

Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=相关推荐

  1. SptingBoot+RabbitMQ整合出现的异常【Connection reset和Channel shutdown: connection error和ForgivingExceptionHa】

    问题 启动项目后项目正常运行,并且RabbitMQ能够正常生产和消费消息,但是运行一段时间后"莫名其妙"报错,报错信息如下(报错重复很多次,以下信息为简化后主要报错信息): 201 ...

  2. Channel shutdown: channel error; protocol method

    Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply ...

  3. Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=

    完整错误 CachingConnectionFactory.java:1278 - Channel shutdown: channel error; protocol method: #method& ...

  4. channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILE

    问题描述 ** MQ发送异常 ** 详细报错信息 Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; prot ...

  5. channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no

    1.出现Error: {:plugins_not_found, [:"rabbitmq_delayed_message_exchange-3.9.0.ez"]} 或者 channe ...

  6. 【RabbitMQ】连接RabbitMQ异常: com.rabbitmq.client.ShutdownSignalException: connection error; protocol meth

    测试该工具类: package com.wj.utils; import com.rabbitmq.client.Connection; import com.rabbitmq.client.Conn ...

  7. Amqp整合com.rabbitmq.client.ShutdownSignalException: channel error; protocol method异常处理

    Amqp整合com.rabbitmq.client.ShutdownSignalException: channel error; protocol method异常处理 参考文章: (1)Amqp整 ...

  8. 【异常报错】com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.c

    在IDEA中,RabbitMQ启动的时候控制台报上面的错误: 我的解决办法是: 将之前生成的target文件删除,重新启动,然后不报错了

  9. 【已解决】 com.rabbitmq.client.ShutdownSignalException: connection error; protocol meth

    测试代码: public class Producer {public static void main(String[] args) throws IOException, TimeoutExcep ...

最新文章

  1. Python最常用的函数、基础语句有哪些?
  2. Android AppCompatCheckBox在低版本上不显示问题
  3. 限制edit只能输入数字
  4. iOS13 已越狱 iOS12.4 已越狱
  5. 【剑指offer】面试题46. 把数字翻译成字符串(java)
  6. 开启 Appserv 的 curl 功能
  7. Spring框架是如何判断是否是上传文件请求呢
  8. 计算机二级access上机题,计算机二级ACCESS上机题库
  9. html input 文本框的一些操作(限制输入...)
  10. static在内存层面的作用_static关键字总结
  11. 通过Google分析页面加载缓慢并优化
  12. mysql读写分离延迟问题_MySQL读写分离后的延迟解决方案
  13. EXCEL的COUNTIF和COUNTIFS函数的区别和联系
  14. 店铺微信公众号怎么创建?
  15. java 强制走catch_关于java:IDE强制使用try / catch包围并且不引发异常
  16. Mac 上编译MapBox Native gl
  17. flutter升级AS和gradle后编译出错(No signature of method: build_gbqp6.android())错误
  18. 什么才是市场急需的前端工程师?【零基础web前端入门视频教程】
  19. python翻译成中文蟒蛇_python为什么叫大蟒蛇
  20. 云原生分布式监控系统?看鹅厂 T11 架构师如何整活儿

热门文章

  1. 文字阴影:css格式
  2. 蓝桥杯嵌入式比赛知识点合集(现在什么都有好吧)
  3. 动态添加OracleParameter 参数
  4. java.lang.IllegalArgumentException: script_lang not supported [ctx._source.text='leven2']
  5. 【软考备战·希赛网每日一练】2023年4月14日
  6. 与我相亲的剩女竟然是个小三
  7. 什么是架构模式和架构风格
  8. numpy中的随机数函数详解
  9. win7怎么把计算机删除文件,win7电脑怎么批量删除文件_win7电脑批量删除文件的方法 - 系统家园...
  10. docker部署项目