NServiceBus
NServiceBus copied to clipboard
Breaking change in settings behavior of `MessageSentToErrorQueue` via `RecoverabilitySettings` changes in v7 results in error
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.