Back-off strategy of handling messages which fail #1172
Closed
chrismoutray
started this conversation in
General
Replies: 1 comment
-
Hi @chrismoutray , if you would like to build a custom retry strategy with variable delays, you might want to look into the transport message API, which is capable of "deferring transport messages" (i.e. send the message currently being handled with a delay) await bus.Advanced.TransportMessage.Defer(TimeSpan.FromMinutes(1)); and the special Please remember to back up your clever retry strategy with some integration tests. 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Hopefully someone can point me in the right direction or tell me I'm being stupid! :). I'm looking for a way to configure Rebus message processing with a back-off strategy for specific messages which fail frequently.
I have a basic Rebus setup with 2 subscriptions for; DispatchMessage and OperationMessage.
Now imagine my queue is flooded with 100's of DispatchMessage's and then after small delay 1 OperationMessage. Btw the messages aren't related.
Sometimes there will be a period of time where the handler for the DispatchMessage keeps failing because its actually making a call to a 3rd party API with failure timeout (30 seconds).
The problem I've observed is that the OperationMessage is not processed until the all DispatchMessage's have been processed, I guess this is expected because of the order they were added to the queue. But I'm wondering if there is a way to make Rebus skip the DispatchMessage's (even its retries) for a period of time leaving Rebus free to process the OperationMessage first and then try the DispatchMessage's later.
Perhaps this isn't a problem to be solved in Rebus in which case I guess the DispatchMessage handler could skip trying the 3rd party API, and re-queue the message with a delay (deferred).
Beta Was this translation helpful? Give feedback.
All reactions