can oslo_messaging support basic.return

Bug #1776492 reported by JiaJunsu
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Consider a scenario like this: A want to send a message to B, when the message reach at the broker, B hasn't create the queue to receive message. I found the broker just drop the message and "basic.publish" sucessed.

The amqp protocol has defined “basic.return” to address such cases. Can oslo_messaging support this?

Revision history for this message
Ken Giusti (kgiusti) wrote :

This is an interesting idea, however the kombu library (which oslo.messaging uses to interface with rabbitmq) does not currently support basic.return. The 'immediate' and 'mandatory' flags are not implemented:


I did try to set those flags on publish - just to see what happens:

File "oslo_messaging/_drivers/", line 807, in ensure
    ret, channel = autoretry_method()
  File "/home/kgiusti/work/openstack/oslo.messaging/.tox/py27/lib/python2.7/site-packages/kombu/", line 494, in _ensured
    return fun(*args, **kwargs)
  File "/home/kgiusti/work/openstack/oslo.messaging/.tox/py27/lib/python2.7/site-packages/kombu/", line 570, in __call__
    return fun(*args, channel=channels[0], **kwargs), channels[0]
  File "oslo_messaging/_drivers/", line 795, in execute_method
  File "oslo_messaging/_drivers/", line 852, in _set_current_channel
  File "/home/kgiusti/work/openstack/oslo.messaging/.tox/py27/lib/python2.7/site-packages/kombu/", line 77, in __init__
  File "/home/kgiusti/work/openstack/oslo.messaging/.tox/py27/lib/python2.7/site-packages/kombu/", line 232, in revive['basic_return'].add(self.on_return)
AttributeError: 'Channel' object has no attribute 'events'

So yeah - it isn't supported.

If the kombu project did decide to provide this we could try using it in oslo.messaging, but for now we can't.

Changed in oslo.messaging:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Gabriele Santomaggio (gsantomaggio) wrote :

Kombu actually supports the mandatory flag.

@kgiusti the error you see in your tests is [1] ( I fixed it, now the tests work)

Mandatory flag can't be used on "memory" transport in kombu since "memory" transport does not follow AMQP protocol, see [2]

btw we are working on "mandatory" flag implementation, see [3],[4] and [5]

Gabriele Santomaggio
Cloud Developer @SUSE


Revision history for this message
Gabriele Santomaggio (gsantomaggio) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.