记RabbitMQ使用报错Error creating bean with name ‘rabbitConnectionFactory‘ defined in class path resource

  • Post author:
  • Post category:其他


1、报错如下:

Error creating bean with name ‘rabbitConnectionFactory’ defined in class path resource [org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration$RabbitConnectionFactoryCreator.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.connection.CachingConnectionFactory]: Factory method ‘rabbitConnectionFactory’ threw exception; nested exception is java.lang.IllegalArgumentException: Address 192.168.74.128:5672:5672 seems to contain an unquoted IPv6 address. Make sure you quote IPv6 addresses like so: [2001:db8:85a3:8d3:1319:8a2e:370:7348]

2、报错原因

Address 192.168.74.128:5672:5672 seems to contain an unquoted IPv6 address. Make sure you quote IPv6 addresses like so: [2001:db8:85a3:8d3:1319:8a2e:370:7348]

识别为ipv6,rabbitmq应当也支持IPV6

3、解决方案

application.yml文件

 rabbitmq:
  #host: 192.168.74.128:5672//去掉端口
  host: 192.168.74.128
  username: admin
  password: 123123
  virtual-host: /



版权声明:本文为qq_54413857原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。