Wit hthe help of the upstream IRC I found that the durable queue only makes the 
queue durable.
As outlined in my former [1].

TL;DR I need to persist the messages on publish.
In my example that is

 channel.basic_publish(exchange='',
-                      routing_key='hello',
-                      body='Hello World!')
+                      routing_key='hellod',
+                      body='Hello World!',
+                      properties=pika.BasicProperties(
+                         delivery_mode = 2, # make message persistent
+                      ))
 print(" [x] Sent 'Hello World!'")
 connection.close()


With that it survives a restart

root@x:~# ./send.py 
 [x] Sent 'Hello World!'
root@x:~# ./send.py 
 [x] Sent 'Hello World!'
root@x:~# rabbitmqctl list_queues name durable messages
Listing queues ...
hellod  true    2
root@x:~# systemctl restart rabbitmq-server
root@x:~# rabbitmqctl list_queues name durable messages
Listing queues ...
hellod  true    2
root@x:~# ./receive.py 
 [x] Received 'Hello World!'
 [x] Received 'Hello World!'

@Iain have we lost messages that were in persistent deliver mode or
might that have been what happened?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1708008

Title:
  rabbitmq-server 3.5.7-1ubuntu0.16.04.2 security update dumped durable
  queues for autopkgtest.ubuntu.com

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/1708008/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to