NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

Breaking change in settings behavior of `MessageSentToErrorQueue` via `RecoverabilitySettings` changes in v7 results in error

Open ramonsmits opened this issue 4 years ago • 0 comments

Settings behavior of MessageSentToErrorQueue via RecoverabilitySettings changes in v7 results in the following error:

The given key NServiceBus.RecoverabilitySettings was not present in the dictionary.

Code sample:

public class MyFeature : Feature
{
    protected override void Setup(FeatureConfigurationContext context)
    {
        var recoverability = context.Settings.Get<RecoverabilitySettings>();
        recoverability.Failed(settings => settings.OnMessageSentToErrorQueue(message =>
        {
            Console.WriteLine(message.MessageId);
            return Task.CompletedTask;
        }));
    }
}

This is due to https://docs.particular.net/nservicebus/upgrades/7to8/#error-notification-events. The user is not getting useful feedback on how to deal with this breaking change.

ramonsmits avatar May 28 '21 07:05 ramonsmits