虚拟主机不会基于配置在RabbitMQ服务器上创建,我必须确保RabbitMQ上的虚拟主机。我是不是漏掉了一些配置。请查找下面的配置
application.yml
spring:
rabbitmq:
host: 127.0.0.1
virtual-host: /defaultVH
username: defaultUser
password: defaultPassword
cloud:
stream:
bindings:
saviyntSampleQueueA:
binder: rabbit-A
contentType: application/x-java-object
group: groupA
destination: saviyntSampleQueueA
saviyntSampleQueueB:
binder: rabbit-B
contentType: application/x-java-object
group: groupB
destination: saviyntSampleQueueB
binders:
rabbit-A:
defaultCandidate: false
inheritEnvironment: false
type: rabbit
environment:
spring:
rabbitmq:
host: 127.0.0.1
virtualHost: /vhA
username: userA
password: paswdA
port: 5672
connection-timeout: 10000
rabbit-B:
defaultCandidate: false
inheritEnvironment: false
type: rabbit
environment:
spring:
rabbitmq:
host: 127.0.0.1
virtualHost: /vhB
username: userB
password: paswdB
port: 5672
connection-timeout: 10000bootstrap.yml
############################################
# default settings
############################################
spring:
main:
banner-mode: "off"
application:
name: demo-service
cloud:
config:
enabled: true #change this to use config-service
retry:
maxAttempts: 3
discovery:
enabled: false
fail-fast: true
override-system-properties: false
server:
port: 8080添加默认弹簧引导添加启用绑定
@EnableBinding({MessageChannels.class})
@SpringBootApplication
public class Configissue1124Application {
public static void main(String[] args) {
SpringApplication.run(Configissue1124Application.class, args);
}
}现在简单直截了当的按摩渠道来调度按摩。
interface MessageChannels {
@Input("saviyntSampleQueueA")
SubscribableChannel queueA();
@Input("saviyntSampleQueueB")
SubscribableChannel queueB();
} 当我运行时,它不会在系统上创建任何Virtualhost。我尝试使用配置服务器购买,提供相同的配置,但仍然没有运气,如果有什么东西丢失,请找。
提前谢谢
发布于 2019-03-21 12:43:13
AMQP协议(或RabbitMQ REST )不提供从客户端提供虚拟主机的机制。
必须在服务器上手动配置虚拟主机。
https://stackoverflow.com/questions/55274959
复制相似问题