X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Ftest%2Fcommon%2Fpublish_response_event_to_kafka_bus.py;fp=near-rt-ric-simulator%2Ftest%2Fcommon%2Fpublish_response_event_to_kafka_bus.py;h=251ba0937c1119a6b3e61e97a20238673e803a2b;hb=f87470c985836d38f7206f2e1e6298c6d010a8a7;hp=635dc6d614806fdf075a2657d4dbbc09bfd4babe;hpb=f0ec1252e0c98e4ee6989ea0a1e0eef9dd06c91b;p=sim%2Fa1-interface.git diff --git a/near-rt-ric-simulator/test/common/publish_response_event_to_kafka_bus.py b/near-rt-ric-simulator/test/common/publish_response_event_to_kafka_bus.py index 635dc6d..251ba09 100644 --- a/near-rt-ric-simulator/test/common/publish_response_event_to_kafka_bus.py +++ b/near-rt-ric-simulator/test/common/publish_response_event_to_kafka_bus.py @@ -51,7 +51,7 @@ def create_kafka_producer(): return producer # Helper: Publishes (to) the target broker and the topic in synch -def publish(kafka_evet, req_id): +def publish(kafka_evet, req_id, targettopic): # Instantiate KafkaProducer with keyword arguments producer = create_kafka_producer() @@ -62,7 +62,7 @@ def publish(kafka_evet, req_id): # synch-publish # KafkaProducer.send(topicname, value=broker_message, key=req_id, headers=None, partition=None, timestamp_ms=None) - fut_rec_metadata = producer.send('kafkatopicres', kafka_evet, req_id) + fut_rec_metadata = producer.send(targettopic, kafka_evet, req_id) return fut_rec_metadata.get() except Exception as err: @@ -74,8 +74,9 @@ if __name__ == '__main__': try: requestid = sys.argv[1] + targettopic = sys.argv[2] # response_data_JSON is str - future = publish(response_data_JSON, requestid) + future = publish(response_data_JSON, requestid, targettopic) if (future is not None): print (0)