can oslo_messaging support basic.return
Bug #1776492 reported by
JiaJunsu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Confirmed
|
Wishlist
|
Unassigned |
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?
To post a comment you must log in.
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:
See: https:/ /github. com/celery/ kombu/blob/ master/ kombu/messaging .py#L129
I did try to set those flags on publish - just to see what happens:
File "oslo_messaging /_drivers/ impl_rabbit. py", line 807, in ensure kgiusti/ work/openstack/ oslo.messaging/ .tox/py27/ lib/python2. 7/site- packages/ kombu/connectio n.py", line 494, in _ensured kgiusti/ work/openstack/ oslo.messaging/ .tox/py27/ lib/python2. 7/site- packages/ kombu/connectio n.py", line 570, in __call__ channels[ 0], **kwargs), channels[0] /_drivers/ impl_rabbit. py", line 795, in execute_method _set_current_ channel( channel) /_drivers/ impl_rabbit. py", line 852, in _set_current_ channel return= my_bad) kgiusti/ work/openstack/ oslo.messaging/ .tox/py27/ lib/python2. 7/site- packages/ kombu/messaging .py", line 77, in __init__ revive( self._channel) kgiusti/ work/openstack/ oslo.messaging/ .tox/py27/ lib/python2. 7/site- packages/ kombu/messaging .py", line 232, in revive _channel. events[ 'basic_ return' ].add(self. on_return)
ret, channel = autoretry_method()
File "/home/
return fun(*args, **kwargs)
File "/home/
return fun(*args, channel=
File "oslo_messaging
self.
File "oslo_messaging
on_
File "/home/
self.
File "/home/
self.
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.