Skip to content

feat: add exchange and broadcast in memory buffer#219

Merged
TCMeldrum merged 3 commits intomasterfrom
add-exchange-broadcast-buffer
Oct 29, 2025
Merged

feat: add exchange and broadcast in memory buffer#219
TCMeldrum merged 3 commits intomasterfrom
add-exchange-broadcast-buffer

Conversation

@TCMeldrum
Copy link
Contributor

Closes UserOfficeProject/issue-tracker#1485

Description

Add more buffers like message buffer so if rabbitmq goes down but the backend stays alive broadcasts and messages to exchanges are not lost. I have also added logging to show how many messages are waiting to be sent.

The messages will still be lost if the backend restarts but this adds a small layer of resiliance that would have helpped during our call deadline where a proposals was submitted in a 2 min window when rabbitmq restarted

Motivation and Context

How Has This Been Tested

Fixes

Changes

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@TCMeldrum TCMeldrum requested a review from a team October 23, 2025 13:22
@yoganandaness
Copy link
Contributor

@TCMeldrum What happens if i have two instances of backend running? Will it have two memory buffers and hence send the message 2x times?

@TCMeldrum
Copy link
Contributor Author

They would yeah but the events sent to the rabbitmq message broker should be inderpendent as they come from the backends events handler. E.g. when a proposal is submitted the proposal submitted event will only exist within the backend that resieved the request. It will then store the event in the buffer until that backend reconnects. This is mostly to cover the case where rabbitmq is unavilible. Does that make sense sorry?

Copy link
Contributor

@yoganandaness yoganandaness left a comment

Choose a reason for hiding this comment

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

Nice

@TCMeldrum TCMeldrum merged commit c82a9a5 into master Oct 29, 2025
1 check passed
@TCMeldrum TCMeldrum deleted the add-exchange-broadcast-buffer branch October 29, 2025 10:55
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.

Store up event to send to message broker if the connection is not avalible

3 participants