BrighterCommand / Brighter

A framework for building messaging apps with .NET and C#.
https://www.goparamore.io/
MIT License
1.98k stars 258 forks source link

Outbox Sweeper: Support circuit breaking of Topics #3155

Open preardon opened 1 week ago

preardon commented 1 week ago

The way in which the outbox sweeper works is to grab the top x dispatched messages and attempt a dispatch every y number of seconds. This problem with this is if the top x messages all fail to dispatch (due to a issue with the Topic / configuration / ect.) then the sweeper will continue to just dispatch the same x messages and fail repeatedly stopping any other messages from dispatching.

Describe the solution you'd like If there is an issue dispatching for a particular topic I would it to be removed from the next x number of attempts to dispatch i.e. if there are 200 messages to TopicA followed 100 messages to TopicB, the dispatcher is set to 100 at at time and there is an issue dispatching to TopicA, on the next tick of the sweeper I would like any messages for TopicA to be ignored and the messages from TopicB to be dispatched

Additional context I have had issues with Topic filling up (1gb) on Azure Service Bus as well as permissions not being correctly applied which have caused the outbox sweeper to essentially stall as it continually tries to dispatch the same un-dispatchable messages