Using MSMQ across several machines

Hi All
I’m using MSMQ transport for my project and have hit a dead stop…

My project uses microservices for backend and WPF applications for frontend.
When I run it on my development machine internally all is well (mostly, some lag when publishing high volume messages), but when I move my applications to another machine for testing, no messages get through. I’ve checked my MSMQ config and believe it to be okay (running in workstation mode, setup with the powershell scripts), I’ve placed the “instance-mapping.xml” file in the root of my project folder and when the app starts up it logs the routing and configured, but still no messages com across the network.
I’ve disabled the firewall on both the “backend” and the “terminal” for testing purposes, but same result.

Any ideas as to how I can debug this issue?

Hi Allan,

Without asking questions I would advice to look at this documentation about troubleshooting issues related to MSMQ:

Especially the second point about messages being stuck can give you some insight on what is happening.

Regards
Michal

I just made 2 fresh virtual machines to test the setup from scratch. Installed the services on one and the application on the other.

The Application receives the “heartbeat events” from the services, but when I try to request data from the services initiated from the application I get an exception.

InnerException:
	The destination queue 'InControlMasterData' could not be found. The destination may be misconfigured for this kind of message (InControl.Core.Common.Contract.NServiceBus.Command.MasterData.Contact.RequestContactGetAllResultAsContactMasterDataOverview) in the routing section of the transport configuration. It may also be the case that the given queue hasn't been created yet, or has been deleted.
	StackTrace:
	   at NServiceBus.UnicastSendRouterConnector.<Invoke>d__1.MoveNext()
	--- 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.RequestResponseExtensions.<Request>d__3`1.MoveNext()
	--- 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 InControl.MasterData.Wpf.App.<MasterDataEndpointRequest>d__56`1.MoveNext()
	InnerException:
		Failed to send message to address: [InControlMasterData]
		StackTrace:
		   at NServiceBus.Transport.Msmq.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTransaction transaction, UnicastTransportOperation transportOperation)
		  at NServiceBus.Transport.Msmq.MsmqMessageDispatcher.Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction, ContextBag context)
		  at (Closure`2 , IDispatchContext )
		  at NServiceBus.RoutingToDispatchConnector.Invoke(IRoutingContext context, Func`2 stage)
		  at NServiceBus.RouteDeferredMessageToTimeoutManagerBehavior.Invoke(IRoutingContext context, Func`2 next)
		  at NServiceBus.UpdateRequestResponseCorrelationTableBehavior.Invoke(IOutgoingPhysicalMessageContext context, Func`1 next)
		  at NServiceBus.SerializeMessageConnector.<Invoke>d__1.MoveNext()
		--- 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.UnicastSendRouterConnector.<Invoke>d__1.MoveNext()
		InnerException:
			The queue does not exist or you do not have sufficient permissions to perform the operation.
			StackTrace:
			   at System.Messaging.MessageQueue.MQCacheableInfo.get_WriteHandle()
			  at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, IntPtr transaction)
			  at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
			  at System.Messaging.MessageQueue.Send(Object obj, String label, MessageQueueTransactionType transactionType)
			  at NServiceBus.Transport.Msmq.MsmqMessageDispatcher.ExecuteTransportOperation(TransportTransaction transaction, UnicastTransportOperation transportOperation)

But I can’t figure out what is wrong.

Is there a test solution in the example section that can be used to test basic communication so I can see if it’s my configuration?

The destination queue ‘InControlMasterData’ could not be found

That seems to suggest that you have configure it to be routed to a local queue. Isn’t it supposed to be on your other VM?

If yes you need to specify the machine name in your routing config:

My Instance-Mapping.xml file looks like this:

<endpoints>
<endpoint name="InControlApplication">
    <instance machine="Server01" />
</endpoint>
<endpoint name="InControlMasterData">
    <instance machine="Server01" />
</endpoint>
<endpoint name="InControlProduct">
    <instance machine="Server01" />
</endpoint>
</endpoints>

Where the IP address is the correct address for the “server” so I’m unsure what else to do…

To clarify further:
Server01:

  • Windows Server 2019
  • MSMQ installed via Platform installer
  • IP address: 192.168.3.254 (seperated network, no firewall)

On the server the queue InControlMasterData exists,
screenshot1

Terminal01:

  • Windows 10 Pro
  • MSMQ installed via Platform installer
  • IP address: 192.168.3.100 (seperated network, no firewall)

On the terminal the queue is pointed to the server with the correct IP address and as it states the queues are connected.

and like I said the “heartbeat” events are coming through.
Let me know if I can deliver more info to help, but this is kinda the only thing stopping me from moving on, so I’m at a dead end with this issue blocking me.

Looking at those screenshots all seems to be well since no messages (except the 10 “subscription messages” stored in the .subscriptions queue) are seems to be stuck.

Do you have any messages in any of the 2 dead letter queues on any of the machines?

and like I said the “heartbeat” events are coming through.

What do you mean with heartbeats, is it Heartbeats • ServiceControl Heartbeats • Particular Docs ?