Commit 03ffe9d2 authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

modify group_if in options of receiver based on sender data_source

parent cc46d3e4
Pipeline #6472 passed with stage
in 49 seconds
......@@ -104,6 +104,11 @@ class Application:
if key not in self.options:
self.options[key] = {}
if "data_source" in self.options["sender"] and "group_id" not in self.options["receiver"]:
sender_data_source = self.options["sender"]["data_source"]
group_id = str(binascii.crc32(sender_data_source.encode()))
self.options["receiver"]["group_id"] = group_id
def _setup_logging(self):
log_level = self.options["log_level"]
format = (
......@@ -161,12 +166,6 @@ class Application:
if sender:
sender.stream = stream
if sender and "group_id" not in self.options["receiver"]:
sender_data_source = self.options["sender"]["data_source"]
group_id = str(binascii.crc32(sender_data_source.encode()))
consumer.group_id = group_id
log.info(f"Set consumer group ID=%s, group_id")
worker = create_instance_from_configurable(
self.worker_class, self.options["worker"])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment