diff --git a/setup.py b/setup.py index b1fdf7d..1aff6d9 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/surge/__init__.py b/surge/__init__.py index 14e168b..5d4a5ed 100644 --- a/surge/__init__.py +++ b/surge/__init__.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/surge/cli.py b/surge/cli.py index c308a14..1cfc941 100644 --- a/surge/cli.py +++ b/surge/cli.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/surge/surge_deployer/surge.py b/surge/surge_deployer/surge.py index 435fee1..23b1b5c 100644 --- a/surge/surge_deployer/surge.py +++ b/surge/surge_deployer/surge.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tests/__init__.py b/tests/__init__.py index 14e168b..5d4a5ed 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tests/test_cli.py b/tests/test_cli.py index 758878b..d0bcf2e 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tests/test_vagrant_deployer.py b/tests/test_vagrant_deployer.py index 4fcd166..edaa793 100644 --- a/tests/test_vagrant_deployer.py +++ b/tests/test_vagrant_deployer.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tools/send_test_data_to_kafka.py b/tools/send_test_data_to_kafka.py index c99a1f9..6466a95 100644 --- a/tools/send_test_data_to_kafka.py +++ b/tools/send_test_data_to_kafka.py @@ -1,5 +1,3 @@ - - # Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -19,37 +17,36 @@ from kafka import KafkaClient from kafka import KafkaConsumer + class Producer(object): - def __init__(self, broker_ip_port): - self.kafka = KafkaClient(broker_ip_port) - self.producer = SimpleProducer(self.kafka) - - def send_message(self): - response = self.producer.send_messages("HEYA","Hello World","Kafka Deployment Worked!") - return [("Error ",response[0].error ), response ] + def __init__(self, broker_ip_port): + self.kafka = KafkaClient(broker_ip_port) + self.producer = SimpleProducer(self.kafka) + + def send_message(self): + response = self.producer.send_messages("HEY", "Hello World", "Kafka Deployment Worked!") + return [("Error ", response[0].error), response] + + def close(self): + self.kafka.close() - def close(self): - self.kafka.close() class Consumer(object): - def __init__(self,broker_ip_port): - self.consumer = KafkaConsumer("HEYA", group_id="my_group", - metadata_broker_list=[broker_ip_port]) - - def consume_message(self): - print self.consumer - for message in self.consumer : - print message - print self.consumer - - - -if __name__== "__main__": - producer = Producer("172.17.1.137:9092") - print producer.send_message() - producer.close() - con = Consumer("172.17.1.137:9092") - con.consume_message() - + def __init__(self,broker_ip_port): + self.consumer = KafkaConsumer( + "HEYA", group_id="my_group", metadata_broker_list=[broker_ip_port]) + + def consume_message(self): + print self.consumer + for message in self.consumer : + print message + print self.consumer + +if __name__ == "__main__": + producer = Producer("172.17.1.137:9092") + print producer.send_message() + producer.close() + con = Consumer("172.17.1.137:9092") + con.consume_message()