diff --git a/neon_mq_connector/connector.py b/neon_mq_connector/connector.py index 9f3281a..6886438 100644 --- a/neon_mq_connector/connector.py +++ b/neon_mq_connector/connector.py @@ -368,7 +368,10 @@ def emit_mq_message(cls, if not request_data: raise ValueError(f'No request data provided') - message_id = request_data.setdefault('message_id', cls.create_unique_id()) + # Ensure `message_id` in data will match context in messagebus connector + request_data.setdefault('message_id', request_data.get("context", {}) + .get("mq", {}).get("message_id") or + cls.create_unique_id()) with connection.channel() as channel: if exchange: