Skip to content

Commit

Permalink
Use supplied route_key if not None
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhamer-noaa committed Oct 28, 2024
1 parent b7dc624 commit 3ae050c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/idsse_common/idsse/common/rabbitmq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class Exch(NamedTuple):
type: str
route_key: str = ''
durable: bool = True
delivery_conf: bool | None = None
mandatory: bool | None = None
delivery_conf: bool | None = False
mandatory: bool | None = False


class Queue(NamedTuple):
Expand Down Expand Up @@ -529,8 +529,11 @@ def _publish(
if success_flag:
success_flag[0] = False
try:
if route_key is None:
route_key = self._exch.route_key

self.channel.basic_publish(self._exch.name,
self._exch.route_key,
routing_key=route_key,
body=message,
properties=properties,
mandatory=self._exch.mandatory)
Expand Down

0 comments on commit 3ae050c

Please sign in to comment.