Persistent rabbitmq message store not working with docker

Issue #930 wontfix
Tim de Wit created an issue

Just noticed that the rabbitmq queue doesn’t survive a docker-compose restart. Already tackled a couple of problems:

  1. The rabbitmq:3-management image by default provides a volume for /var/lib/rabbitmq (where the message store resides). The current docker-compose.yml file doesn’t specify a named volume, so a random volume name is generated on every docker-compose startup, leaving a bunch of unused volumes behind after a while. solution: add the following to the broker entry inside the yml file:

    volumes: - rabbitmq_volume:/var/lib/rabbitmq

    Also add “rabbitmq_volume:” to the list of volumes at the bottom.

  2. Docker-compose assigns a randomly generated hostname to every freshly started container. Rabbitmq stores its message store under: /var/lib/rabbitmq/_data/rabbit@<hostname>/msg_stores. In order to maintain this path in between restarts, specify a hostname for the broker container in the yml file:

    hostname: openrem-broker

It still doesn’t seem to work though…

Comments (3)

  1. Ed McDonagh

    Thanks Tim, appreciate the report, and the fix!

    For the second part, I’m guessing the hostname must be different to the container name? Because that is set for the broker at this line

  2. Tim de Wit reporter

    No the actual hostname doesn’t seem to matter.. as long as its constant between restarts. The message store is now stored under:
    ~/.local/share/containers/storage/volumes/openremdocker308c16557e70_openrem-broker_volume/_data/mnesia/rabbit@openrem-broker/msg_stores/

  3. Ed McDonagh

    Hi @Tim de Wit - we've removed RabbitMQ from OpenREM now, so this issue doesn't apply anymore. We might need to test how the new system works in this scenario though!

  4. Log in to comment