python multithreading application for fetching messages from rabbitmq
-1
1
Worker.counter =0 confobj.thread_count =2 def callback(ch, method, properties, body): if(Worker.counter<confobj.thread_count): logObject = json.loads(body) th=Worker(Worker.counter+1,logObject,confobj,fileobj) Worker.counter+=1 th.start() else: print("All threads are busy.") time.sleep(2) ch.basic_ack(delivery_tag = method.delivery_tag) channel.basic_qos(prefetch_count=1) channel.basic_consume(callback, queu`enter code here`e=confobj.queue) channel.start_consuming() I want maxthread should be 2 such that first message is accessed by first thread, second message by second thread, third message by first thread again and so on And then I want to insert that messages into elastic search without skipping...