1. 网页端15672配置vhost
(1)创建vhost:Admin => Virtual Hosts
进入virtual host的设置页面。

创建你的vhost。

(2)给vhost授权
从Users中选中你的用户名,进入该用户管理的vhost进行授权。

给刚刚创建的vhost授权:编辑+读+写

2. application.yml配置vhost
spring:
rabbitmq:
virtual_host: ai_jwjb_miner
注意 :yml配置的名称必须和RabbitMQ网页端的vhost名称完全一样。不可写为/ai_jwjb_miner或./ai_jwjb_miner。否则会出现:Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - vhost /ai_jwjb_miner not found, class-id=10, method-id=40)的报错。