[rabbitmq-discuss] RabbitMQ queue durability question

Jan Jacobs janj at econsys.co.za
Tue Sep 3 11:08:15 BST 2013


Hi Emile

Thanks for your response.

On 03/09/2013 10:50, Emile Joubert wrote:
> Hi Jan,
>
> On 03/09/13 08:59, Jan Jacobs wrote:
>
>> A queue is created by the server or the client
> Are you sure the server and client declare a queue with the same attributes?
I am using libraries in the respective implementations.
Server:
I am using the amqp_rpc_server from the amqp_client.
 From the source code:

     process_flag( trap_exit, true ),

     %% Get config from config file for the server and port
     Params =
     #amqp_params_network
     {
         username  = amqp_conf:username()
         ,password = amqp_conf:password()
         ,host     = amqp_conf:server()
         ,port     = amqp_conf:port()
     },

     try amqp_connection:start( Params ) of
         {ok, Connection}
         ->
             {
                 ok
                 ,State#state
                 {
                   connection    = Connection
                   ,time_started = {date(), time()}
                   ,server       = amqp_rpc_server:start( Connection, 
State#state.queue, State#state.handler )
                 }
             }
     catch
         _:Reason -> {stop, Reason}
     end

Client:
I am using the RabbitMQ plugin for Grails:

// RabbitMQ
rabbitmq
{
     connectionfactory
     {
         username = 'guest';
         password = 'guest';
         hostname = '127.0.0.1';
         consumers = 1;
     }

     retryPolicy {
         maxAttempts = 3
     }

     queues =
     {
         'unitrac.application.MaxManV1.RPC'()
     }
}

 From the documentation:
" the|autoDelete|,|durable|and|exclusive|attributes default to|false|and 
the|arguments|attribute defaults to null."

>
>> If the client and the server is active and the broker restarts then the
>> broker change the queue durability to |durable|: true and it survives
>> the restart.
> That is not possible, because the non-durable queue is not present on
> startup. The broker can't change the queue durability, and neither can a
> client. A queue must be deleted before the durability or any other
> attribute can be changed.
>
> A possible explanation is that the server and client don't create the
> queue with the same attributes, and you see different behaviour
> depending on which one gets to declare the queue.
>
>
>
> -Emile
>

According to me the server and the client declare the queue with the 
same attributes, but I will investigate more by only having one of them 
active when I restart the broker. That will indicate which one is 
responsible.

Thanks
-- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130903/a98c2f1b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JanEmailSignature.gif
Type: image/gif
Size: 9261 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130903/a98c2f1b/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: janj.vcf
Type: text/x-vcard
Size: 167 bytes
Desc: not available
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130903/a98c2f1b/attachment.vcf>


More information about the rabbitmq-discuss mailing list