How to rabbitmq-plugins enable rabbitmq_event_exchange in a different vhost not default vhost

392 views
Skip to first unread message

John Mattucci

unread,
Oct 24, 2016, 5:33:00 PM10/24/16
to rabbitmq-users
Just wondering how would I 'rabbitmq-plugins enable rabbitmq_event_exchange'  in a different vhost not default the vhost?


Thank you

Michael Klishin

unread,
Oct 25, 2016, 2:03:31 AM10/25/16
to rabbitm...@googlegroups.com
Plugins are enabled node-wide.

On Tue, Oct 25, 2016 at 12:32 AM, John Mattucci <mattuc...@gmail.com> wrote:
Just wondering how would I 'rabbitmq-plugins enable rabbitmq_event_exchange'  in a different vhost not default the vhost?


Thank you

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

John Mattucci

unread,
Oct 25, 2016, 9:17:37 AM10/25/16
to rabbitmq-users
But in https://github.com/rabbitmq/rabbitmq-event-exchange it states "It declares a topic exchange called 'amq.rabbitmq.event' in the default virtual host." And I wish to reference this exchange from a queue I created however it gives me the error "NOT_FOUND - no exchange 'amq.rabbitmq.event' in vhost '7857ed26-fccc-4ffc-bd95-1f20064ce451'" and I don't see amq.rabbitmq.event in the list of exchanges from the admin dashboard, however i see [E*] rabbitmq_event_exchange           3.6.3 when I do rabbitmq-plugins list.



On Tuesday, 25 October 2016 02:03:31 UTC-4, Michael Klishin wrote:
Plugins are enabled node-wide.

On Tue, Oct 25, 2016 at 12:32 AM, John Mattucci <mattuc...@gmail.com> wrote:
Just wondering how would I 'rabbitmq-plugins enable rabbitmq_event_exchange'  in a different vhost not default the vhost?


Thank you

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Oct 25, 2016, 9:21:29 AM10/25/16
to rabbitm...@googlegroups.com
The event exchange plugin always uses default vhost — which can be configured for nodes that are blank
and need to initialise from scratch — by design.

In other words, you must connect to the default vhost if you intend to consume the events. There is no way to use
an arbitrary vhost or multiple vhosts.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Oct 25, 2016, 9:24:45 AM10/25/16
to rabbitm...@googlegroups.com
Perhaps some background explanation is warranted: plugins that publish data to an exchange (such as the event-exchange one)
need to decide what vhost to use because

1. We cannot not use any: resources such as exchanges in RabbitMQ always belong to a vhost.
2. Publishing to all vhosts makes no sense and will consume resources for no reason.

so plugin authors need to pick a vhost and in every case I've seen it's the default vhost [1] or
outright hardcode the "/" one (<<"/">>), even though it's not necessarily a great idea.


John Mattucci

unread,
Oct 25, 2016, 10:35:05 AM10/25/16
to rabbitmq-users
So in order to have this plugin exposed to a different vhost I would have to verify the plugin to check if its hardcoded or references the value in rabbitmq.config and then updated it accordingly?

Michael Klishin

unread,
Oct 25, 2016, 10:47:28 AM10/25/16
to rabbitm...@googlegroups.com
You can configure the plugin to use any vhost you want but it can only be one vhost:
use `rabbitmq_event_exchange.vhost` [1].

1. https://github.com/rabbitmq/rabbitmq-event-exchange/blob/master/src/rabbit_exchange_type_event.erl#L93

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

John Mattucci

unread,
Oct 25, 2016, 10:57:22 AM10/25/16
to rabbitmq-users
Are there future plans to have the plugin accept multiple vhosts?

Thanks again for your time.

Michael Klishin

unread,
Oct 25, 2016, 11:31:35 AM10/25/16
to rabbitm...@googlegroups.com
I don't think so. The stream of internal events is an inherently global thing that's only of interest to system operators.

John Mattucci

unread,
Oct 25, 2016, 12:13:37 PM10/25/16
to rabbitmq-users
This leads me to ask, am I using the rabbit-event-exchange for its intended purpose, since in a PAAS environment where a service can be bound to a service such as rabbit and each space is assigned its own vhost

Michael Klishin

unread,
Oct 25, 2016, 2:39:41 PM10/25/16
to rabbitm...@googlegroups.com
It is only meant to be used by operators. We don't know anything about your intent so can't comment further.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

John Mattucci

unread,
Oct 25, 2016, 3:06:47 PM10/25/16
to rabbitmq-users
A queue is created which is bound to amq.rabbitmq.event and in turn based on the event messages i.e. queue is created, deleted etc. an action is undertaken
Reply all
Reply to author
Forward
0 new messages