You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "René Cordier (Jira)" <se...@james.apache.org> on 2022/01/10 09:26:00 UTC

[jira] [Created] (JAMES-3694) Add a TTL on RabbitMQ queues

René Cordier created JAMES-3694:
-----------------------------------

             Summary: Add a TTL on RabbitMQ queues
                 Key: JAMES-3694
                 URL: https://issues.apache.org/jira/browse/JAMES-3694
             Project: James Server
          Issue Type: Improvement
    Affects Versions: 3.6.0
            Reporter: René Cordier


In our production environments we encountered some strange phenomenons: some queues marked as autodelete (like for the mailbox eventBus) are still present while having no consumers with a consequent number of messages in it.

Checking the RabbitMQ doc https://www.rabbitmq.com/queues.html#temporary-queues

```
An auto-delete queue will be deleted when its last consumer is cancelled (e.g. using the basic.cancel in AMQP 0-9-1) or gone (closed channel or connection, or lost TCP connection with the server).

If a queue never had any consumers, for instance, when all consumption happens using the basic.get method (the "pull" API), it won't be automatically deleted. For such cases, use exclusive queues or queue TTL.
```

Could we be sometimes after some issues in a case where that queue never had any consumers? 

For this, I propose to add a TTL to the queue https://www.rabbitmq.com/ttl.html#queue-ttl. According to the doc, even if there was no consumer to the queue, it will be deleted after the ttl if we set this up.

Of course it should be a configurable optional field in rabbitmq.properties file. Something like this:

```
notification.queue.ttl=3600000 # unit in ms
```
The unit is in ms, so the default would be 3600000ms -> 1h



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org