素材巴巴 > 程序开发 >

springboot连接不了Rabbitmq问题

程序开发 2023-09-21 09:45:23

问题

Rabbitmq是搭建在虚拟机上,在管理页面登录成功,同时创建了个新用户,也赋予权限,如图
在这里插入图片描述
但是在springboot集成过程中,却发现连接不了问题,度娘一番无果,百思不得其解,问题如下:

2018-12-18 09:35:30 29055 [SimpleAsyncTaskExecutor-1] ERROR o.s.a.r.l.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s). 
 org.springframework.amqp.AmqpIOException: java.io.IOExceptionat org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71)at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:368)at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:573)at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430)at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411)at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1387)at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:336)at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1171)at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1422)at java.lang.Thread.run(Thread.java:748)
 Caused by: java.io.IOException: nullat com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105)at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101)at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:353)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:909)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1013)at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:356)... 8 common frames omitted
 

配置如下:

  rabbitmq:host: 192.168.153.133port: 15672username: lsspassword: 888888virtual-host: /
 

解决:端口改成5672


标签:

上一篇: npm包管理,这一篇就够了 下一篇:
素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。