How do you shutdown the tutorial client without raising an exception?

Asked by Jonathan Stoppani

when trying to close the connection to the AMQP server as showed in the tutorial (adding a lambda callback with "reactor.stop()"), the following exception is thrown:

Unhandled error in Deferred:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/txAMQP-0.2-py2.6.egg/txamqp/", line 48, in close
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/", line 992, in put
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/", line 243, in callback
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/", line 312, in _startRunCallbacks
--- <exception caught here> ---
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.3-fat.egg/twisted/internet/", line 328, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/txAMQP-0.2-py2.6.egg/txamqp/", line 32, in _raiseIfClosed
    raise Closed()

Looking at the source code it seems that someone is listening on incoming messages using a TimeoutDeferredQueue but is not catching Closed exceptions. Is it possible? Am I wrong somewhere?

Question information

English Edit question
txAMQP Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Esteve Fernandez (esteve) said :

There's a bug in AMQClient#connectionLost which makes TimeoutDeferredQueue to raise an exception if the queue is closed. In the meantime until that bug is fixed, just comment out connectionLost.


Can you help with this problem?

Provide an answer of your own, or ask Jonathan Stoppani for more information if necessary.

To post a message you must log in.