NServiceBus exception handling and message replay mechanism

We plan to use NServiceBus in our application to send messages. In our case, each message has a property timeToLivethat determines the period of time in which this message should be processed.

In the event that message processing was unsuccessful on the first try, our plan is to move it to a specific repository of retries (retry queue), and then retry the message (with some timeouts between retries), or it will timeToLiveexpire .

If the deadline has timeToLiveexpired, we plan to register the contents of the message and discard the message.

Actually, this repetition behavior is mainly determined by the protocol that we implement.

Are there any ways to achieve this behavior with NServiceBus? I see that failed messages go to the specific error queue. Is it possible to create a separate bus that points to the error queue?

+3
source share
1 answer

I would suggest that you have a separate process that keeps track of the queue of errors executing retries in accordance with the logic you are describing. Take a look at the ReturnToSourceQueue tool that comes with nservicebus for inspiration:

http://nservicebus.svn.sourceforge.net/viewvc/nservicebus/trunk/src/tools/management/Errors/ReturnToSourceQueue/NServiceBus.Tools.Management.Errors.ReturnToSourceQueue/Class1.cs?view=markup

, , : http://andreasohlund.net/2010/03/15/errorhandling-in-a-message-oriented-world/

, !

+4

Source: https://habr.com/ru/post/1736987/


All Articles