Delayed consumption or delayed dispatching of a rabbitmq message

rabbitmq-delayed-message-exchange

Is there any planning to support this rabbitmq feature? I tried looking in the https://github.com/nameko/nameko/blob/master/nameko/messaging.py but couldn’t find anything that allows delayed consumption of a rabiitmq message.

You can already use this plugin in conjunction with Nameko’s Publisher DependencyProvider.

First you’d declare an exchange as type=x-delayed-message, then use the x-delay header when publishing. Something like this:

from kombu.messaging import Exchange

exchange = Exchange(type="x-delayed-message")

class Service:
    name = "delayed_message"

    publish = Publisher(exchange=exchange, headers={"x-delay": 100})  # default delay

    def method(self, delay):
        self.publish("payload", ..., headers={"x-delay": delay})  # override delay
1 Like

Is this still valid and can it work with the default dispatcher and event_handler?