def server():
    global kafka, producer, consumer
    if platform.system() == 'Windows':
        win32api.SetConsoleCtrlHandler(handler, 1)
    else:
        signal.signal(signal.SIGINT, onexit)
    
    try:
        kafka = KafkaClient(kafkaHost,timeout=None)
        consumer = SimpleConsumer(kafka, kafkaGroup, kafkaTopic, partitions=[0,1,2])

        for message in consumer:
            print(message)
    except Exception as e:
        print('Exception {0}'.format(e))
        print('Can not consume actions')
        print(traceback.format_exc())
    except KeyboardInterrupt:
        onexit()
    finally:
        onexit()
dataset/ETHPy150Open xumiao/pymonk/tests/kafka_tester.py/server/original