SpringBoot链接RabbitMQ错误 Failed to instantiate [com.rabbitmq.client.Connection]
程序员文章站
2024-03-15 23:34:42
...
错误
Failed to instantiate [com.rabbitmq.client.Connection]: Factory method ‘mqConnectionSeckill’ threw exception; nested exception is java.io.IOException
原因
- 当前用户没有访问权限
设置权限
- rabbitmq配置错误
没有配置rabbitmq.virtual-host = /
写成了rabbitmq.virtual-host=
#Rabbitmq配置
rabbitmq.address-list=localhost:5672
rabbitmq.username=guest
rabbitmq.password=guest
rabbitmq.publisher-confirms=true
rabbitmq.virtual-host=/
rabbitmq.queue=seckill