import pika
import json
username='0ccb6575-a617-44b5-a58f-ba6a77d1e372'
apiKey='This is little bit confidential'
id='0ccb6575-a617-44b5-a58f-ba6a77d1e372/9957c26627a78b2e8867dff771580afdbe7d8389943c807497f404e1039c070d'
URL='databroker.cos.iudx.org.in'
port=24567
vHost='IUDX'
queue_name = id
connection = pika.BlockingConnection(pika.URLParameters(f'amqps://{username}:{apiKey}@{URL}:{port}/{vHost}'))
channel = connection.channel()
print(' [*] Waiting for data. To exit press CTRL+C')
def callback(ch, method, properties, body):
print(" [x] %r" % body)
print("====================")
channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
channel.start_consuming()
this script from IUDX website starts consuming data but after giving 4-8 records it crashes , is there any way to add start and end Duration so that I can only get Data for a particular Period.
New contributor
Lalit Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1