rabbitmq-delayed-message-exchange icon indicating copy to clipboard operation
rabbitmq-delayed-message-exchange copied to clipboard

Specifying a Delay Through Exchange Argument

Open IdanWo opened this issue 6 years ago • 1 comments

Motivation:

Since the x-delay is a message header attribute, delay can only be specified per message and through publisher's code.

There should be an alternative way for specifying the desired delay as for these goals:

  1. Seamlessly support running systems: In case of current running system, adding delayed messages requires change in the existing publishers code. We prefer not to make any modifications to the existing publishers.
  2. Policy-like behavior: support for specifying the same default delay to all queues, current and future ones, for all messages.

Implementation:

The requirement can be achieved through:

  1. Exchange argument - the optimal approach.
  2. Plugin configuration setting - less optimal, but might be more easy as for current internal API parts.

Point to consider:

There should be a clear priority which according to the delay is specified. In my opinion, this is the right priority:

  1. If exists in the message header argument, the delay is specified by this argument.
  2. If exists in the exchange argument, the delay is specified by the this argument.
  3. If no relevant argument is found, then the message will not be delayed.

IdanWo avatar Sep 07 '18 22:09 IdanWo

I'm asking without any knowledge about how the plugins work.

We use rabbitmq-message-deduplication which also uses a custom exchange type, so we couldn't use both. We can't have unique delayed events which would be great.

nachitox avatar Jun 08 '21 15:06 nachitox