Spring-boot集成RabbitMQ踩过的坑

Posted coax

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring-boot集成RabbitMQ踩过的坑相关的知识,希望对你有一定的参考价值。

1.java.net.SocketException: socket closed

  官方文档已经说明,新建user和guest的账户是没有远程登录的权限的 需要对登录所用账户授权

   解决方法:

rabbitmqctl  set_permissions -p /${user_name}  user_admin \'.*\' \'.*\' \'.*\'

2.

An unexpected connection driver error occured  报错如下
[AMQP Connection 192.168.71.111:5672] WARN com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured (Exception message: Connection reset)
Exception in thread "main" com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
    at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:342)
    at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:62)
    at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:99)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:900)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:817)
    at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:954)

 

 这是因为Rabbit里的queue 没有 注解@RabbitListener(queues = "namedQueue")  queues的实例

    解决方法:

  添加监听的queues名称,保存  重启 。OK

以上是关于Spring-boot集成RabbitMQ踩过的坑的主要内容,如果未能解决你的问题,请参考以下文章

Spring 4.2.2以上版本和swagger集成方案和踩过的坑

Spring 4.2.2以上版本和swagger集成方案和踩过的坑

Spring 4.2.2以上版本和swagger集成方案和踩过的坑

Spring 4.2.2以上版本和swagger集成方案和踩过的坑

Spring 4.2.2以上版本和swagger集成方案和踩过的坑

Android easeui 3.0 即时通讯 我踩过的坑