Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ temporary clients #4360

Merged
merged 6 commits into from
Dec 12, 2024
Merged

RabbitMQ temporary clients #4360

merged 6 commits into from
Dec 12, 2024

Conversation

pcapriotti
Copy link
Contributor

@pcapriotti pcapriotti commented Dec 5, 2024

This PR implements "temporary" queues for listening to events not bound to a specific client, meant to be used by team management or similar services.

When GET /events is called without a client_id parameter, we create a new temporary queue and bind it to the user-notifications exchange with routing keys <user-id> and <user-id>.temporary.

When a notification is published to RabbitMQ to all clients of a user, nothing changes, and <user-id> is used as its routing key. When it is published to a list of clients, it is now also published with routing key <user-id>.temporary. Each notifications is only published once with the <user-id>.temporary routing key even if the user has multiple capable clients.

When the websocket is closed, the temporary queue is deleted.

https://wearezeta.atlassian.net/browse/WPB-11173

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@echoes-hq echoes-hq bot added the echoes/initiative: scale Enterprise Readiness Initiatives label Dec 5, 2024
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 11, 2024
@pcapriotti pcapriotti marked this pull request as ready for review December 11, 2024 14:59
We need this between channel creation and message consumption. Thus, we
have to squeeze this action into the setup.
Copy link
Contributor

@supersven supersven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@supersven supersven merged commit 27849c6 into develop Dec 12, 2024
11 checks passed
@supersven supersven deleted the rabbitmq-temp branch December 12, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/initiative: scale Enterprise Readiness Initiatives ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants