Created
          May 11, 2016 19:19 
        
      - 
      
 - 
        
Save scisco/ec359da9544798fd7e19ce2d2aaa7099 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
Scisco created this gist
May 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import json import pika url = 'amqp://url/' connection = pika.BlockingConnection(pika.URLParameters(url)) channel = connection.channel() while True: method_frame, header_frame, body = channel.basic_get('default') if method_frame: if method_frame.message_count < 1000: break else: print(method_frame.message_count) body = json.loads(body.decode('utf8')) if body['task'] == 'plans.tasks.calculate_task_totals' or body['task'] == 'plans.tasks.calculate_aoi_totals': print('discarded') channel.basic_ack(method_frame.delivery_tag) else: print(body) else: break