Skip to content

Instantly share code, notes, and snippets.

@jameskeane
Created October 11, 2012 15:01
Show Gist options
  • Save jameskeane/9fe5507c2e7169bb93b2 to your computer and use it in GitHub Desktop.
Save jameskeane/9fe5507c2e7169bb93b2 to your computer and use it in GitHub Desktop.
from pika.adapters import BlockingConnection
connection = BlockingConnection()
while True:
try:
channel = connection.channel()
# This should error, RabbitMQ will send a channelClose with the error
channel.queue_declare(queue='garbage-queuename-that-will-404', passive=True)
except Exception, e:
print 'We want 404: ', e
raw_input('Now run rabbitmqctl list_channels, press enter to error on another channel and watch the channels list grow')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment