Include documentation and updates for MON manual installation.
[osm/MON.git] / core / message_bus / producer.py
index 4956292..1b0de7a 100644 (file)
@@ -47,13 +47,13 @@ class KafkaProducer(object):
 
         self._topic= topic
 
-        if "ZOOKEEPER_URI" in os.environ:
-            broker = os.getenv("ZOOKEEPER_URI")
+        if "BROKER_URI" in os.environ:
+            broker = os.getenv("BROKER_URI")
         else:
-            broker = "localhost:2181"
+            broker = "localhost:9092"
 
         '''
-        If the zookeeper broker URI is not set in the env, by default,
+        If the broker URI is not set in the env, by default,
         localhost container is taken as the host because an instance of
         is already running.
         '''
@@ -65,7 +65,7 @@ class KafkaProducer(object):
 
     def publish(self, key, value, topic=None):
         try:
-            future = self.producer.send(key, value, topic)
+            future = self.producer.send(topic=topic, key=key, value=value)
             self.producer.flush()
         except Exception:
             logging.exception("Error publishing to {} topic." .format(topic))