MSMQ Transport Fully Qualified Domain Names

Component: MSMQ Transport
NuGet Package NServiceBus (6.x)
Standard support for version 6.x of NServiceBus has expired. For more information see our Support Policy.

The MSMQ Transport uses the local machine name, taken from Environment.MachineName, as the originator and reply-to address in messages by default.

Some deployment environments require the use of Full Qualified Domain Names (FQDM) to route messages correctly. The most common scenario is routing between machines in different domains.

To override the machine name resolution, provide a factory method to RuntimeEnvironment.MachineNameAction when an endpoint is configured.

Check how to find FQDM of local machine for a good starting point on how to get the FQDM of the local machine.

RuntimeEnvironment.MachineNameAction = () =>
    return Dns.GetHostEntry(Environment.MachineName).HostName;

The routing configuration and any explicit queue destinations will also need to use FQDM.

Last modified