Handling Delayed NServiceBus Messages

I have an NServiceBus application for which this message cannot be processed due to some external event that did not happen. Since this other event is not an NSB event, I cannot correctly implement the sagas.

However, instead of just restarting the message (which will cause the loop until this external event occurs), I wrap the message with another message (DelayMessage) and a queue that instead. DelayMessage is picked up by another service and placed in the database before the retry interval expires. At this point, the delay service reloads the message in the original queue so that another attempt can be made.

However, this can happen more than once if this external event has not yet occurred, and in the case when it never even happens, I want to limit the number of round trips that the message receives. This means that the DelayMessage property has the MaxRetries property, but it is lost when the delay service pauses the original message for repetition.

What other options am I missing? I am glad to accept that there is a completely different solution to this problem.

+1
c # delayed-execution nservicebus
source share
1 answer

Think of an implementation of saga that saves this first message, holding it until the second message is received. You may also want the saga to open timeout , so that your process will not wait indefinitely if this second message is lost or something.

+4
source share

All Articles