blob: bd49c09ac6e761ccd5469ac3b9d7f7f0ed1b4b88 [file] [log] [blame]
khenb95fe9a2016-10-05 11:15:25 -07001#!/usr/bin/env python
2import threading, logging, time
3
4from kafka import KafkaConsumer
5
khenb95fe9a2016-10-05 11:15:25 -07006class Consumer(threading.Thread):
7 daemon = True
8
9 def run(self):
Khen Nursimulub99f0832016-10-05 11:20:17 -070010 consumer = KafkaConsumer(bootstrap_servers='10.100.198.220:9092',
khenb95fe9a2016-10-05 11:15:25 -070011 auto_offset_reset='earliest')
12 consumer.subscribe(['voltha-heartbeat'])
13
14 for message in consumer:
15 print (message)
16
17
18def main():
19 threads = [
20 Consumer()
21 ]
22
23 for t in threads:
24 t.start()
25
26 time.sleep(3000)
27
28if __name__ == "__main__":
khenb95fe9a2016-10-05 11:15:25 -070029 main()
30