Skip to content

Commit

Permalink
Bug Fix: Setting Generated Message ID as default value, skipping it w…
Browse files Browse the repository at this point in the history
…hile already set (#90)
  • Loading branch information
NeonKirill authored Jul 26, 2023
1 parent 58f2ad4 commit 225fd13
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions neon_mq_connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,8 @@ def emit_mq_message(cls,
:raises ValueError: invalid request data provided
:returns message_id: id of the sent message
"""
if request_data and len(request_data) > 0 and isinstance(request_data,
dict):
message_id = cls.create_unique_id()
request_data['message_id'] = message_id
if request_data and len(request_data) > 0 and isinstance(request_data, dict):
message_id = request_data.setdefault('message_id', cls.create_unique_id())
with connection.channel() as channel:
if exchange:
channel.exchange_declare(exchange=exchange,
Expand Down

0 comments on commit 225fd13

Please sign in to comment.