Skip to content
Snippets Groups Projects
Commit b03f7246 authored by Cody Messick's avatar Cody Messick
Browse files

Save hop credential so Kafka producer health checks don't need to regenerate it

parent d19f926d
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,8 @@ class KafkaBase:
def __init__(self, name, config, prefix):
self.name = name
self._config = config
self._hop_stream = Stream(auth=self.get_auth(prefix))
self._credential = self.get_auth(prefix)
self._hop_stream = Stream(self._credential)
# FIXME Drop get_payload_content method once
# https://github.com/scimma/hop-client/pull/190 is merged
......@@ -148,7 +149,7 @@ class KafkaWriter(KafkaBase):
kafka_url = self._config['url']
_, _, broker, topic = kafka_url.split('/')
try:
topics = list_topics(kafka_url, timeout=5)
topics = list_topics(kafka_url, auth=self._credential, timeout=5)
if topics[topic].error is None:
log.info(f'{kafka_url} appears to be functioning properly')
return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment