iis服务器助手广告
返回顶部
首页 > 资讯 > 后端开发 > JAVA >ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker
  • 325
分享到

ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker

java-rabbitmqrabbitmqjava 2023-09-01 14:09:19 325人浏览 八月长安
摘要

初次接触 RabbitMQ 出现问题 使用 SpringBoot 集成 RabbitMQ 启动时出现问题 pom.xml org.springframework.boot spring-

初次接触 RabbitMQ 出现问题
使用 SpringBoot 集成 RabbitMQ 启动时出现问题
pom.xml

<parent>    <groupId>org.springframework.bootgroupId>    <artifactId>spring-boot-starter-parentartifactId>    <version>2.1.6.RELEASEversion>parent><dependency>    <groupId>org.springframework.amqpgroupId>    <artifactId>spring-rabbitartifactId>dependency>

application.yml

spring:  rabbitmq:    host: 192.168.163.131    port: 5672    username: rabbit    passWord: 123456    virtual-host: /

出现如下问题:

org.springframework.amqp.rabbit.listener.exception.FatalListenerStartupException: Authentication failureat org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:576) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessinGConsumer.initialize(SimpleMessageListenerContainer.java:1196) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1041) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at java.lang.Thread.run(Thread.java:750) [na:1.8.0_333]Caused by: org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:65) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:509) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:702) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:214) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$RabbitResourceFactory.createConnection(ConnectionFactoryUtils.java:293) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:131) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:93) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:76) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:570) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]... 3 common frames omittedCaused by: 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:362) ~[amqp-client-5.4.3.jar:5.4.3]at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1104) ~[amqp-client-5.4.3.jar:5.4.3]at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054) ~[amqp-client-5.4.3.jar:5.4.3]at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:994) ~[amqp-client-5.4.3.jar:5.4.3]at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:462) ~[spring-rabbit-2.1.7.RELEASE.jar:2.1.7.RELEASE]... 10 common frames omitted

引发此问题的原因是只在 rabbitMQ 中配置了一个账号
如下操作都是在 Admin & Users 选项卡下完成的
在这里插入图片描述

在这里插入图片描述
需要在添加一个默认的 guest 账号,密码也是 guest
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
然后重新启动应用,会发现可以成功启动。至此结束。。。

来源地址:https://blog.csdn.net/weixin_38407312/article/details/127524101

--结束END--

本文标题: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker

本文链接: https://www.lsjlt.com/news/388598.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作