Advertisement
Guest User

Test Sending Script

a guest
Oct 16th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import pika
  3. import uuid
  4.  
  5. connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
  6.  
  7. channel = connection.channel()
  8.  
  9. count = 0
  10.  
  11. while (count < 500000):
  12.         headers = {'message-distribution-hash': str(uuid.uuid4())}
  13.         channel.basic_publish(exchange='logging.topic',routing_key='error',body='Test Message',properties=pika.BasicProperties(headers=headers))
  14.         count = count + 1
  15.         print " [x] Sent 'Test Message' Number " + str(count)
  16.  
  17. connection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement