Reputation: 44094
After some months I am finally back to using nservicebus and started to test it out on a server. Unfortunately I am getting this exception
The queue does not exist or you do not have sufficient permissions to perform the operation.
I've checked using computer manager and the queue does exist and I have granted everybody full control over the queue however this problem persists. What am I doing wrong?
I am using
var bus = NServiceBus.Configure.With()
.SpringBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.LoadMessageHandlers()
.CreateBus()
.Start();
and
<MsmqTransportConfig
InputQueue="ListenQueue"
ErrorQueue="error"
NumberOfWorkerThreads="1"
MaxRetries="5"
/>
I works just fine on my dev box. The full stack trace (which doesn't seem all that useful) looks like
System.Messaging.MessageQueueException was unhandled
Message=The queue does not exist or you do not have sufficient permissions to perform the operation.
Source=NServiceListener
ErrorCode=-2147467259
StackTrace:
at NServiceListener.Program.Main(String[] args) in C:\temp\NServiceListener\NServiceListener\Program.cs:line 35
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Upvotes: 2
Views: 3029
Reputation: 44094
As it turns out I'm an idiot and Udi would have solved this in a second had I posted all the required information. My config file contains
<MsmqTransportConfig
InputQueue="ListenQueue"
ErrorQueue="error"
NumberOfWorkerThreads="1"
MaxRetries="5"
/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="EnformMessages" Endpoint="EnformMessages" />
</MessageEndpointMappings>
</UnicastBusConfig>
As you can see I'm attempting to listen to messages on a non-existent queue called EnformMessages. Changing that to the InputQueue name or changing the InputQueue name to EnformMessages solved the problem. I am embarrassed by my stupidity
Upvotes: 2