(Would publish to a Pika mailing list if there was one, but since there doesn't seem to be...)<br><br>After registering a returned message handler in Pika, I noticed that it only gets called once. Digging into the code, I see this:<br>
<br> def add_on_return_callback(self, callback):<br> """<br> Pass a callback function that will be called when basic_publish as sent<br> a message that has been rejected and returned by the server. The<br>
callback handler should receive a method, header and body frame. The<br> base signature for the callback should be the same as the method<br> signature one creates for a basic_consume callback.<br> """<br>
<b> self.callbacks.add(self.channel_number, '_on_basic_return', callback)</b><br><br>The CallbackManager.add() method is defined like this:<br><br> def add(self, prefix, key, callback,<b> one_shot=True</b>, only_caller=None):<br>
<br>Since add_on_return_callback doesn't specify a value for the one_shot keyword arg, it defaults to True, which explains exactly the behavior I'm seeing.<br><br>Is this the correct behavior or an oversight?<br><br>
Thanks,<br><br>Matt<br>