<s> __author__ = """<STR_LIT>""" <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from os import getcwd <EOL> from os import sys <EOL> sys . path . append ( getcwd ( ) ) <EOL> from MOAL . helpers . display import Section <EOL> from MOAL . helpers . datamaker import random_person <EOL> from kafka import SimpleProducer , KafkaClient , KafkaConsumer <EOL> DEBUG = True if __name__ == '<STR_LIT:__main__>' else False <EOL> KAFKA_URL = '<STR_LIT>' <EOL> kafka = KafkaClient ( KAFKA_URL ) <EOL> producer = SimpleProducer ( kafka ) <EOL> topics = [ '<STR_LIT>' ] <EOL> consumer = KafkaConsumer ( '<STR_LIT>' , <EOL> group_id = '<STR_LIT>' , <EOL> bootstrap_servers = [ '<STR_LIT>' ] ) <EOL> if DEBUG : <EOL> with Section ( '<STR_LIT>' ) : <EOL> for topic in topics : <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> producer . send_messages ( topic , '<STR_LIT:{}>' . format ( random_person ( ) ) ) <EOL> for message in consumer : <EOL> print ( "<STR_LIT>" . format ( <EOL> message . topic , message . partition , <EOL> message . offset , message . key , <EOL> message . value ) ) </s>
