初次接触 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文档到电脑,方便收藏和打印~
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0