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

Making the message bus reliable #332

Open
Arseniy-Popov opened this issue Jan 14, 2022 · 3 comments
Open

Making the message bus reliable #332

Arseniy-Popov opened this issue Jan 14, 2022 · 3 comments

Comments

@Arseniy-Popov
Copy link

I wonder if the message bus used in production at MADE is different from the one described in the book in ways which make it more reliable. In the scenario of a batch quanity change deallocating a number of order lines, if the service dies after a batch quantity has been changed, but before the order lines have been allocated again, they are going to end up unallocated as events are not persisted.

One way of rectifying this that I see is writing events to a message broker, perhaps using a transactional outbox, to a channel internal to the inventory service, to be later consumed by the same service. Another way is writing events to a database and having a poller querying the database and consuming events from it as one of the entrypoints into the service.

Both this options seem to nullify the need for the message bus by replacing it either with a message broker or a database as the place where events reside inbetween being processed. So I wonder if these approaches are feasible at all and what your thinking is on how an in-app and a persistent message buses compare.

If someone apart from the maintainers wants to chime in on this, please do!

@dbaber
Copy link

dbaber commented May 5, 2024

I think in the Epilogue they talk about this and they use EventStore.

@georgek
Copy link

georgek commented Jun 28, 2024

Why not process the whole message bus in a single unit of work?

@hjwp
Copy link
Contributor

hjwp commented Jul 3, 2024

it depends what you want really. after you finish processing one event, you have to decide whether you want to commit and persist your changes, or if you want to move on to provessing all the other events that may have been generated (and the ones they generate, and the ones they generate...), and then decide if it's ok that an error in one of those downstream events causes your whole transaction to be rolled back. it really depends on how independent they handling of each event needs to be, from a business perspective.

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

No branches or pull requests

4 participants