From 1343b259636eabd82610a389f563bfe31f80d887 Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Tue, 27 Nov 2018 12:11:30 -0500 Subject: [PATCH] Use custom Kafka client ID --- parsedmarc/kafkaclient.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parsedmarc/kafkaclient.py b/parsedmarc/kafkaclient.py index fccf23c4..43d21847 100644 --- a/parsedmarc/kafkaclient.py +++ b/parsedmarc/kafkaclient.py @@ -9,6 +9,8 @@ from kafka.errors import NoBrokersAvailable, UnknownTopicOrPartitionError from collections import OrderedDict from parsedmarc.utils import human_timestamp_to_datetime +from parsedmarc import __version__ + logger = logging.getLogger("parsedmarc") @@ -38,7 +40,8 @@ class KafkaClient(object): """ config = dict(value_serializer=lambda v: json.dumps(v).encode( 'utf-8'), - bootstrap_servers=kafka_hosts) + bootstrap_servers=kafka_hosts, + client_id="parsedmarc-{0}".format(__version__)) if use_ssl or username or password: config["security_protocol"] = "SSL" config["ssl_context"] = ssl.create_default_context()