Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing DelayedDelivery configuration causes ArgumentNullException exceptions at runtime #541

Open
timbussmann opened this issue Feb 15, 2023 · 0 comments
Labels

Comments

@timbussmann
Copy link
Contributor

The latest version of the msmq transport requires a msmq.DelayedDelivery setting to be provided in order to make use of features that use delayed messages like

  • Delayed sends (e.g. sendOptions.DelayDeliveryWith or sendOptions.DoNotDeliverBefore)
  • Delayed retries (enabled by default)
  • Saga timeouts via RequestTimeout<T>

However, there is nothing forcing users to configure delayed delivery when making use of these delayed features. This will end in unhelpful exceptions at runtime when sending delayed messages, attempting to schedule delayed retries or when requesting saga timeouts:

System.ArgumentNullException: 'Value cannot be null. Parameter name: address'

System.ArgumentNullException
  HResult=0x80004003
  Message=Value cannot be null.
Parameter name: address
  Source=NServiceBus.Transport.Msmq
  StackTrace:
   at NServiceBus.Transport.Msmq.MsmqAddress.Parse(String address)
   at NServiceBus.Transport.Msmq.MsmqMessageDispatcher.SendToDelayedDeliveryQueue(TransportTransaction transaction, UnicastTransportOperation transportOperation)
   at NServiceBus.Transport.Msmq.MsmqMessageDispatcher.Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction, CancellationToken cancellationToken)

The endpoint needs to be configured with a delayed delivery storage as documented here or all usages of delayed delivery have to be avoided/disabled, e.g.

  • No delayed sends
  • No Saga timeouts
  • Disable delayed retries endpointConfiguration.Recoverability().Delayed(d => d.NumberOfRetries(0));
@timbussmann timbussmann changed the title Missing DelayedDelivery configuration causes runtime errors Missing DelayedDelivery configuration causes ArgumentNullException exceptions at runtime Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant