Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHINENG-13501: produce msg to hbi with key org_id #116

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion yuptoo/lib/produce.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def delivery_report(err, msg=None, is_msg_for_hbi=False):
try:
bytes = json.dumps(msg, ensure_ascii=False).encode("utf-8")
if kafka_topic == UPLOAD_TOPIC:
producer.produce(kafka_topic, bytes, callback=partial(delivery_report, is_msg_for_hbi=True))
org_id = request_obj.get('org_id') if request_obj else None
key = org_id.encode("utf-8") if org_id else None
producer.produce(kafka_topic, bytes, key, callback=partial(delivery_report, is_msg_for_hbi=True))
else:
producer.produce(kafka_topic, bytes, callback=delivery_report)
producer.poll(1)
Expand Down
Loading