Josh
Josh

Reputation: 1058

Nservicebus possible to publish an event when a message gets moved to error queue?

I have a saga that does a bulk import by creating a bunch of commands (It keeps track of the # of commands sent) then listens to an event indicating the task succeeded. I would also like to be notified when the command fails (moves into error queue).

I want to take advantage of nservicebus's retry functionality so I don't want to simply wrap it in a try catch, I really only want to publish this event when it is moving to the error queue.

Is it possible to create another end point that handles the generated commands but listens to the error queue? Or is there another better way to accomplish this?

Upvotes: 4

Views: 856

Answers (1)

Adam Fyles
Adam Fyles

Reputation: 6050

You can take control over how the exceptions are handled using a custom fault handler

Upvotes: 2

Related Questions