in src/influxDBTokenStreamHandler.py [0:0]
def publish_response(self) -> None:
"""
Publish the InfluxDB token on the token response topic.
Parameters
----------
None
Returns
-------
None
"""
try:
request = PublishToTopicRequest()
request.topic = self.publish_topic
publish_message = PublishMessage()
publish_message.binary_message = BinaryMessage()
publish_message.binary_message.message = bytes(self.influxDB_json, "utf-8")
request.publish_message = publish_message
operation = self.publish_client.new_publish_to_topic()
operation.activate(request)
futureResponse = operation.get_response()
futureResponse.result(TIMEOUT)
logging.info('Successfully published InfluxDB token response to topic: {}'.format(self.publish_topic))
except concurrent.futures.TimeoutError as e:
logging.error('Timeout occurred while publishing to topic: {}'.format(self.publish_topic), exc_info=True)
raise e
except UnauthorizedError as e:
logging.error('Unauthorized error while publishing to topic: {}'.format(self.publish_topic), exc_info=True)
raise e
except Exception as e:
logging.error('Exception while publishing to topic: {}'.format(self.publish_topic), exc_info=True)
raise e