For some reason, the SqlServerDelayedMessageStore copies the SQL commands from SqlConstants into internal variables but only in the Initializemethod on line 111..115.
Unfortunately this Initialize method is only called when EnableInstallershas been set. Not setting EnableInstallers does not copy those commands and the entire DelayedMessages in MSQM is not working and throws continuous errors that the CommandText has not been set.
Please list the version of the relevant packages or applications in which the bug exists.
2.0.0 - 2.0.3
Steps to reproduce
Set up DelayedDeliver on MSMQ
Do not execute EnableInstallers()
Relevant log output
NServiceBus.Transport.Msmq.DelayedDelivery.DueDelayedMessagePoller[0]
Failure during timeout polling.
System.InvalidOperationException: BeginExecuteReader: CommandText property has not been initialized
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.BeginExecuteReaderInternal(CommandBehavior behavior, AsyncCallback callback, Object stateObject, Int32 timeout, Boolean inRetry, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.BeginExecuteReaderAsync(CommandBehavior behavior, AsyncCallback callback, Object stateObject)
at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1](Func`4 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, Object state, TaskCreationOptions creationOptions)
at System.Threading.Tasks.TaskFactory`1.FromAsync[TArg1](Func`4 beginMethod, Func`2 endMethod, TArg1 arg1, Object state)
at System.Data.SqlClient.SqlCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.SqlServerDelayedMessageStore.<FetchNextDueTimeout>d__15.MoveNext() in /_/src/NServiceBus.Transport.Msmq/DelayedDelivery/Sql/SqlServerDelayedMessageStore.cs:line 140
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.Transport.Msmq.DelayedDelivery.DueDelayedMessagePoller.<Poll>d__8.MoveNext() in /_/src/NServiceBus.Transport.Msmq/DelayedDelivery/DueDelayedMessagePoller.cs:line 193
Additional Information
Workarounds
Do EnableInstallers() and it works
Possible solutions
Use SqlConstants directly instead of copied variables?
Describe the bug
Description
For some reason, the SqlServerDelayedMessageStore copies the SQL commands from SqlConstants into internal variables but only in the
Initialize
method on line 111..115.Unfortunately this
Initialize
method is only called whenEnableInstallers
has been set. Not settingEnableInstallers
does not copy those commands and the entire DelayedMessages in MSQM is not working and throws continuous errors that theCommandText
has not been set.Expected behavior
That it's working?
Actual behavior
Versions
Please list the version of the relevant packages or applications in which the bug exists.
Steps to reproduce
EnableInstallers()
Relevant log output
Additional Information
Workarounds
EnableInstallers()
and it worksPossible solutions
Additional information