[rabbitmq-discuss] Pre-create queues and exchanges

Jason McIntosh mcintoshj at gmail.com
Mon Jun 17 16:37:10 BST 2013

We are doing ours statically through server automation scripts.  The
reasoning being we wanted more control over this, since we have remote
systems to shovel to a central location.  Due to the shoveling config (from
what I'm seeing there's no way to auto-shovel ALL queues, each has to be
defined), we limited the ability to create queues/exchanges/policies.  That
also puts more "conversation" and automation in the systems group on how
messaging gets routed, handled, failover, etc.  The option of using
federated instead of shovels might work though I've not investigated how
you could programatically create federated exchanges, know how to connect
to remote systems with out more information than most applications have.

If all of your publishers/consumers were hitting the same set of rabbit
nodes, I'd imagine it'd be a different situation than ours and having your
application create the exchanges, queues and binding to them would be more


On Fri, Jun 14, 2013 at 12:02 PM, Simon MacMullen <simon at rabbitmq.com>wrote:

> On 14/06/13 14:48, Dmitry Andrianov wrote:
>> Hi guys.
>> What is the best practices on who should create all the queues and
>> exchanges?
> Whichever works best for you :)
>  I see the three options:
>> 1. consumer-app creates everything and it MUST be started before the
>> producer-app
> That's probably not ideal.
>  2. both consumer-app and producer-app create these objects on startup so
>> it does not matter which one starts first.
> This is probably closest to "the spirit" of AMQP. I think the expectation
> is that producers and consumers should declare the things that they
> directly interact with. So for example for pub-sub a producer would only
> declare the exchange it would publish to, and then consumers declare
> exchange, queue and binding.
>  3. queues and exchanges are put into the broker configuration so they
>> are created automatically when broker starts.
> This keeps your apps free of the need to declare things - but it's only
> going to work if your configuration is quite static.
>  It looks to me that #3 would be the best way. The apps do not need to
>> have any code which initialises stuff, user accounts
>> applications use can be restricted etc.
>> But I cannot find the "official" way of doing it.
>> We tried using shovel plugin because it allows you to declare all these
>> queues and exchanges to be created.
>> It kind of works but it feels a bit dodgy.
> You can do that - or use http://www.rabbitmq.com/**management.html#load-**
> definitions <http://www.rabbitmq.com/management.html#load-definitions>
> Cheers, Simon
> --
> Simon MacMullen
> RabbitMQ, Pivotal
> ______________________________**_________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.**rabbitmq.com<rabbitmq-discuss at lists.rabbitmq.com>
> https://lists.rabbitmq.com/**cgi-bin/mailman/listinfo/**rabbitmq-discuss<https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>

Jason McIntosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130617/2a7f4191/attachment.htm>

More information about the rabbitmq-discuss mailing list