[rabbitmq-discuss] Lose messages between restarts of broker

Dave Gorman csharp4me at gmail.com
Wed Oct 27 23:15:31 BST 2010

I am testing the durability of my message app and noticed messages being
dropped if I restart the broker. I'm running the broker directly in a
console using

I then publish 10,000 messages and I've set the exchange to durable, the
queue to durable, and the message delivery to "2" - as I understand this to
be the configuration for messages to be durable. I then use the rabbitmqctl
list_queues to show the 10,000 messages. I close the broker window, to mimic
a hard shutdown of a server. When I start the broker back up and list the
queues I see 8,428 messages.

Do you know why I would lose messages?

My environment is: Windows 7 64bit and am running RabbitMQ 2.1.1 (disk node)
on top of Erlang 8.1.1.

My publisher code looks like:

var connectionFactory = new ConnectionFactory();
connectionFactory.Address = "localhost";

using (IConnection connection = connectionFactory.CreateConnection())
using (IModel model = connection.CreateModel())
model.ExchangeDeclare("ug.message", ExchangeType.Topic, true);
model.QueueDeclare("ug.message.rtls", true);
model.QueueBind("ug.message.rtls", "ug.message", "#", false, null);

for (int i = 0; i < 10000; i++)
IBasicProperties messageProperties = model.CreateBasicProperties();
messageProperties.DeliveryMode = 2;

byte[] message = System.Text.Encoding.UTF8.GetBytes("Yo Mama soo fat..." +
model.BasicPublish("ug.message", "ug.message.rtls.move", messageProperties,

System.Console.WriteLine("Published message " + i);

Any help would be greatly appreciated.

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101027/dfec28ef/attachment.htm>

More information about the rabbitmq-discuss mailing list