tags:

views:

36

answers:

1

Does NServiceBus automatically attempt to redeliver messages if handling fails? And if it does, is there a limit in the number of times delivery can be attempted?

+2  A: 

NSB will enlist in a distributed transaction and if it fails it will retry the configured number of times. Look at the MsmqTransport config section.

EDIT: A distributed transaction begins as soon as you peek or receive a message from MSMQ. All of the work you do in a message handler will be included in the transaction and it is governed by the Distributed Transaction Coordinator. The DTC will also include things like DB transactions if you are updating DBs and so on.

If say a DB update fails, the whole thing rolls back and the message is put back on the queue.

Adam Fyles
Can you elaborate on what NSB considers a 'distributed transaction'? For example, ActiveMQ can wrap all incoming and outgoing messages in a single session which is transactional.
Cantrell
Check out the edit, it works the same..
Adam Fyles