From b6d98c07b418b16061ae92392947d5dd6958a708 Mon Sep 17 00:00:00 2001 From: David Arthur Date: Sat, 30 Mar 2013 00:28:00 -0400 Subject: Big code re-org --- example.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'example.py') diff --git a/example.py b/example.py index ced32dd..9329312 100644 --- a/example.py +++ b/example.py @@ -1,6 +1,7 @@ import logging from kafka.client import KafkaClient, FetchRequest, ProduceRequest +from kafka.consumer import SimpleConsumer def produce_example(kafka): message = kafka.create_message("testing") @@ -20,11 +21,8 @@ def produce_gz_example(kafka): kafka.send_message_set(request) def main(): - kafka = KafkaClient("localhost", 9092) - produce_example(kafka) - produce_gz_example(kafka) - consume_example(kafka) - kafka.close() + client = KafkaClient("localhost", 9092) + consumer = SimpleConsumer(client, "test-group", "my-topic") if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) -- cgit v1.2.1