[rabbitmq-discuss] a request for a new feature in rabbitmq - prefix to randomly named queues.

Alvaro Videla videlalvaro at gmail.com
Wed Apr 20 15:21:24 BST 2011


Hi,

As Matthias said, it should be pretty simple to generate your own random queue names. Still, if you want the server to do it for you and be able to provide a custom prefix, you can try patch I attached.

An erlang client that use this "extension" could be something like this:

-module(test_declare_prefix).

-export([test_prefix/1]).

-include("amqp_client.hrl").

test_prefix(Prefix) ->
    {ok, Connection} = amqp_connection:start(network, #amqp_params{}),
    {ok, Channel} = amqp_connection:open_channel(Connection),
    #'queue.declare_ok'{queue = Name} 
        = amqp_channel:call(Channel, #'queue.declare'{exclusive = true, auto_delete = true, 
                                      arguments = [{<<"x-name-prefix">>, longstr, Prefix}]}),
    amqp_channel:close(Channel),
    amqp_connection:close(Connection),
    Name.

See the <<"x-name-prefix">> there.

Cheers,

Alvaro

On Apr 20, 2011, at 11:34 AM, Matthias Radestock wrote:

> On 20/04/11 10:21, mysurf mail wrote:
>> Thanks for the reply . I am aware of it but when the system starts
>> running and all the clients are loaded in their computers I look at
>> the queues and get something like that (And usualy a lot more )
>> 
>> amq.gen-e6P2EpkGILdyipBFgyL8Og==        5
>> amq.gen-ei6+QWU2xEZ5rksix82WOg==        0
>> amq.gen-1k/o9ZMzPOUD/OTrPu+tLQ==        0
>> amq.gen-e126P2kGILdyipBFgyL8Og==        5
>> amq.gen-ei612+U2xEZ5rksix82WOg==        0
>> amq.gen-1k9ZMzP12OUD/OTrPu+tLQ==        0
>> amq.gen-e6pkGI3Ld12yipBFgyL8Og==        5
>> amq.gen-ei6+QWxEZ5rks12ix82WOg==        0
>> amq.gen-1k/o9ZzPOUD3/OTrPu+tLQ==        0
>> 
>> Now for maintenance reason I would love to add prefix for each group
>> or subject in my system.
> 
> Why don't you simply get your clients to generate the queue names? It's
> not exactly hard to generate a unique random string. Then you can use
> any naming scheme you want.
> 
> 
> Matthias.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Sent form my Nokia 1100





More information about the rabbitmq-discuss mailing list