New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteClosedException occurs from multiple threads #12

henter opened this Issue Nov 29, 2013 · 3 comments


None yet
2 participants
Copy link

henter commented Nov 29, 2013

Exception like "NOT_ALLOWED - attempt to reuse consumer tag 'rabbitpy.1.139714802256464'"

Exception in thread Thread-101:
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "", line 28, in main
    for message in queue.consume_messages(False, 10):
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 110, in consume_messages
    with self.consumer(no_ack, prefetch) as consumer:
  File "/usr/lib/python2.7/", line 17, in __enter__
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 92, in consumer
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 178, in prefetch_count
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 181, in rpc
    return self._wait_on_frame(frame_value.valid_responses)
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 254, in _wait_on_frame
    value = self._read_from_queue()
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 207, in _read_from_queue
  File "/usr/local/lib/python2.7/dist-packages/rabbitpy/", line 199, in _check_for_exceptions
    raise exception
RemoteClosedException: (530, "NOT_ALLOWED - attempt to reuse consumer tag 'rabbitpy.1.139714802256464'")

This comment has been minimized.

Copy link

gmr commented Dec 18, 2013

Can you provide an example of what you're trying to do? It appears that you're trying to run two consumers using the context manager. This is currently not supported and I don't know if I will support that with this library...

Are you trying to run two different threads, each with its own connection, channel and consumer? I would expect that to work.


This comment has been minimized.

Copy link

henter commented Dec 20, 2013

yes, I've fixed my code to run only one consumer for each thread, it's works fine.
thanks for your reply.


This comment has been minimized.

Copy link

gmr commented Dec 23, 2013


@gmr gmr closed this Dec 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment