Reputation: 416
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?
Upvotes: 0
Views: 2577
Reputation: 42461
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())
Upvotes: 0
Reputation: 416
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
Upvotes: 1