配置“ amq.rabbitmq.event”交换到其他虚拟主机?

时间:2018-08-09 11:18:53

标签: rabbitmq rabbitmq-exchange

我正在使用RabbitMQ插件配置rabbitmq_event_exchange。我正在使用此插件来收听RabbitMQ events。默认情况下,该插件在默认vhost(/)中创建一个名为“ amq.rabbitmq.event”的交换。但是,我尝试将虚拟主机更改为“测试”(由我创建的自定义虚拟主机),根据插件页面上的instructions,我添加了属性 rabbitmq_event_exchange.vhost = test 在我的Rabbitmq.conf文件中。但是当我尝试运行RabbitMQ时出现了异常

    Config file generation failed 10:50:18.141 [error] You've tried to 
    set rabbitmq_event_exchange.vhost, but there is no setting with 
    that name.
    10:50:18.141 [error]   Did you mean one of these?
    10:50:18.176 [error]     mqtt.exchange
    10:50:18.176 [error]     log.exchange.level
    10:50:18.176 [error]     management.listener.port
    10:50:18.176 [error] Error generating configuration in phase 
    transform_datatypes
    10:50:18.176 [error] Conf file attempted to set unknown variable: 
    rabbitmq_event_exchange.vhost

我的Rabbitmq.conf文件

    management.load_definitions= /opt/definitions.json
    #MQTT config
    mqtt.default_user= guest
    mqtt.default_pass= guest
    mqtt.allow_anonymous= false
    mqtt.exchange= MQTT
    mqtt.vhost= test

    #RabbitMQ event exchange config
    rabbitmq_event_exchange.vhost= test

1 个答案:

答案 0 :(得分:0)

该插件尚未提供新的样式配置架构。我在插件GitHub页面中提出了一个issue,以进行此增强。我们必须使用advanced.config文件和经典配置格式来configure自定义虚拟主机。

advanced.config

[
  {rabbitmq_event_exchange, [{vhost, <<"test">>}]}
].

参考:https://groups.google.com/forum/#!topic/rabbitmq-users/Z7_5WGc2ubE