rabbitmq-server start losing data over durable queues

2.3k views Asked by At

On windows, when I am using rabbitmq-server start/stop commands, data over the RabbitMQ durable queues are deleted. It seems queues are re-created when I start the RabbitMQ server.

If I use rabbitmqctl stop_app/start_app, I am not losing any data. Why?

What will happen if my server goes down and how can I be sure I that I won't lose data if it does?

2

There are 2 answers

0
melihcoskun On BEST ANSWER

configuration issue: I was starting rabbitmq from rabbitmq sbin directory. I re-installed the rabbitmq and added rabbitmq to windows services. Now data lost problem was solved on my computer. When I start/stop the windows service , rabbitmq is not losing any data

3
Mark Bramnik On

Making queues durable is not enough. Probably you'll need also to declare exchange as durable as well as send 'persistent' messages.

In Java you'll use:

channel.basicPublish("", "sample_queue",
        MessageProperties.PERSISTENT_TEXT_PLAIN, // note that this parameter is not null!
        message.getBytes())