Skip to content

Commit 28a0dec

Browse files
Brutus5000claude
andcommitted
refactor(mq): align queue name with FAF naming pattern
`<exchange>.<service>.<routing-key>` like the API's `faf-lobby.api.event.update`, plus the hostname suffix because each lobby pod has its own queue (shared-queue services omit the suffix). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 17f2467 commit 28a0dec

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

server/client_message_queue_service.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ def __init__(
5858
self._consumer_tag: Optional[str] = None
5959

6060
async def initialize(self) -> None:
61-
# On k8s `socket.gethostname()` returns the pod name (e.g.
62-
# `faf-lobby-server-6d9c4588ff-lzdcr`); locally it's the dev's
63-
# hostname. Either way it identifies the consumer in the broker UI.
64-
queue_name = f"faf-lobby.client-notify.{socket.gethostname()}"
61+
# Queue naming follows `<exchange>.<service>.<routing-key>` plus a
62+
# per-instance suffix because each lobby pod has its own queue (vs.
63+
# the API's shared queues like `faf-lobby.api.event.update`). On k8s
64+
# `socket.gethostname()` resolves to the pod name (e.g.
65+
# `faf-lobby-server-6d9c4588ff-lzdcr`); locally it's the dev's host.
66+
queue_name = (
67+
f"{config.MQ_EXCHANGE_NAME}.lobby.client.notify"
68+
f".{socket.gethostname()}"
69+
)
6570
result = await self.message_queue_service.declare_queue_and_consume(
6671
exchange_name=config.MQ_EXCHANGE_NAME,
6772
routing_key=CLIENT_NOTIFY_ROUTING_KEY,

0 commit comments

Comments
 (0)