[rabbitmq-discuss] Question/clarification wrt durable messages

Brian Parkinson parki at whatevernot.com
Thu Dec 16 20:03:33 GMT 2010


Hello:

Spending time getting up to speed with RabbitMQ - have things working - very impressed - all's working pretty well, but there are some subtleties I'm trying to figure out, mainly related to durability.

Quick question about durability of messages - I'm missing something, I think.

Let's say that I have a queue set up as durable, non-exclusive, non-auto-delete:

channel.queueDeclare("testQueue", true, false, false, null);

and have this queue bound to an exchange (binding key = routing key).

I would expect that:

channel.basicPublish(exchangeName, routingKey, null, messageString.getBytes());

would result in a message being published in a non-durable fashion (as the properties are null), whereas:

channel.basicPublish(exchangeName, routingKey, MessageProperties.PERSISTENT_TEXT_PLAIN, messageString.getBytes());

would result in a durable publish.

However, as near as I can tell, there is no difference - in both cases, the message remains in the queue until a consumer comes and retrieves it. Is there a difference in this case?

So, I figured that perhaps the second case (PERSISTENT_TEXT_PLAIN) results in the message being available after a server crash (which makes sense). So, I publish a message with PERSISTENT_TEXT_PLAIN and then kill the server and re-launch it; I don't see the message being available - the server comes up without this message in the queue.

Can anyone shed light on what I'm missing?

Perhaps it's more useful to outline what my use case is - I need to have high availability, and so can form a multi-node broker, but since the queues are (currently) tied to a node, if a node goes down, I lose the queue (and all the messages in that queue). How does one design this setup in RabbitMQ/AMQP - I'm guessing there's a pretty standard pattern here (?).

Any help is appreciated - everything else is looking really good - things Just Work.

ps. I'm using the whizzy mgmt web front end; when I launch the server, I see some warnings about undefined functions (see below). Is this something I should worry about?

Thanks.

brian...


rabbit: sudo /opt/local/sbin/rabbitmq-server 
Password:
Activating RabbitMQ plugins ...
*WARNING* Undefined function fdsrv:bind_socket/2
*WARNING* Undefined function fdsrv:start/0
*WARNING* Undefined function fdsrv:stop/0
*WARNING* Undefined function webmachine_resource:start_link/2
6 plugins activated:
* amqp_client-2.2.0
* mochiweb-1.3
* rabbit_management-2.2.0
* rabbit_management_agent-2.2.0
* rabbit_mochiweb-2.2.0
* webmachine-1.7.0
...



More information about the rabbitmq-discuss mailing list