Skip to content

Commit

Permalink
Troubleshoot message_id handling for transactional routing
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jul 26, 2023
1 parent f898591 commit 1b2d9a4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions neon_mq_connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def send_message(self,
exchange: Optional[str] = '',
queue: Optional[str] = '',
exchange_type: ExchangeType = ExchangeType.direct,
expiration: int = 1000) -> str:
expiration: int = 1000,
override_message_id: bool = True) -> str:
"""
Wrapper method for creation the MQ connection and immediate propagation
of requested message with that
Expand All @@ -434,6 +435,7 @@ def send_message(self,
:param exchange_type: type of exchange to use
(defaults to ExchangeType.direct)
:param expiration: posted data expiration (in millis)
:param override_message_id: if True, generate a unique `message_id`
:returns message_id: id of the propagated message
"""
Expand All @@ -454,12 +456,14 @@ def send_message(self,
else:
LOG.debug(f'Sending {exchange_type} request to exchange '
f'{exchange}')
msg_id = self.emit_mq_message(mq_conn,
queue=queue,
request_data=request_data,
exchange=exchange,
exchange_type=exchange_type,
expiration=expiration)
msg_id = self.emit_mq_message(
mq_conn,
queue=queue,
request_data=request_data,
exchange=exchange,
exchange_type=exchange_type,
expiration=expiration,
override_message_id=override_message_id)
LOG.info(f'Message propagated, id={msg_id}')
return msg_id

Expand Down

0 comments on commit 1b2d9a4

Please sign in to comment.