Search code examples
nservicebus

Don't allow NServiceBus saga to be executed again


Is it possible to prohibit saga to be runned again for the same correlation id after it have been completed? now nsericebus just delete saga's row from the database.


Solution

  • If a saga is started by a message type that is received later, after an instance of a saga has already been completed, a new instance of that saga will be created. Otherwise, messages will be ignored.

    Either correlation ID has to be unique or saga should not be completed until it is safe to do so.