4
votes

I'm trying to set the overflow behavior of a particular queue in the Rabbitmq to reject messages exceeding the max limit. I'm using the web console to add a new queue and set the x-max-length. Then I manually added x-overflow and gave it the value of reject-publish. But it seems the default overflow behavior is the one that is getting applied, where the older messages are removed and new ones are enqueued.

Is the way I'm defining the overflow behavior wrong? Could someone please point me how I should be setting the overflow behavior via the web console?

2

2 Answers

0
votes

Its not work via web gui, only through cli. Example:

rabbitmqctl set_policy limit-1gb ".*" '{"max-length-bytes":1000000000,"overflow":"reject-publish"}' --apply-to queues
rabbitmqctl set_policy limit-1m ".*" '{"max-length":1000000,"overflow":"reject-publish"}' --apply-to queues
0
votes

The x-overflow option is only available for classic queues and NOT quorum queues. So if you were using quorum queue this is the explanation.

Currently (in Rabbit 3.8.5) the quorum queue only supports drop-head overflow, and not reject-publish or reject-publish-dlx.