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

Add dead letter exchanges and queues to rabbitmq #1834

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Add dead letter exchanges and queues to rabbitmq #1834

merged 2 commits into from
Jul 22, 2024

Conversation

rtrinque
Copy link
Contributor

There is a need from the govuk-chat app to be able to control the amount of delay that is used when a message from the govuk_chat_pulished_documents is retried. At the moment, a message will be retried immediately. The desired outcome is that we could have a message be sent away for a fixed amount of time before it is back in the queue.
The way we do this is we set a dead letter exchange for the govuk_chat_published_documents called govuk_chat_retry_dlx This dlx then send all incoming messages to a queue called govuk_chat_retry. this queue has a message-ttl value set and a dead letter exchange set to an exchange called govuk_chat_dlx. This last exchange route all incoming messages back to govuk_chat_published_documents.

The result of all this is that when a message is rejected in govuk_chat_published_documents, it ends up in the govuk_chat_retry queue, it will then wait here for the message-ttl value before expiring. After expiration it is sent back to
govuk_chat_published_documents.

There is a need from the govuk-chat app to be able to control the
amount of delay that is used when a message from the
govuk_chat_pulished_documents is retried. At the moment, a message
will be retried immediately. The desired outcome is that we could
have a message be sent away for a fixed amount of time before it
is back in the queue.
The way we do this is we set a dead letter exchange for the
govuk_chat_published_documents called govuk_chat_retry_dlx
This dlx then send all incoming messages to a queue called
govuk_chat_retry. this queue has a message-ttl value set and a
dead letter exchange set to an exchange called govuk_chat_dlx.
This last exchange route all incoming messages back to
govuk_chat_published_documents.

The result of all this is that when a message is rejected in
govuk_chat_published_documents, it ends up in the govuk_chat_retry
queue, it will then wait here for the message-ttl value before
expiring. After expiration it is sent back to
govuk_chat_published_documents.
Copy link

@ianhowell-gds ianhowell-gds left a comment

Choose a reason for hiding this comment

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

Looks ok to me

As the setup introduced by 0e5d205
is a bit unusual, we add some clarification in the readme.
@rtrinque rtrinque merged commit 42d8a20 into main Jul 22, 2024
2 checks passed
@rtrinque rtrinque deleted the retry branch July 22, 2024 08:40
@rtrinque rtrinque restored the retry branch July 22, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants