I am converting my first endpoint to use code configuration + an instance-mapping xml file. Using MSMQ and NSB 6.x.
We previously had the build swap out a unicast bus config file based on environment, so we could change the publisher’s endpoint (queue) name AND the server name per environment. This was useful, as in some cases we would use a suffix on the endpoint name that represented the environment (e.g. “Accounts_QA”).
With the code + instance mapping method, it looks like the registered publisher name needs to match the endpoint name in the mapping:
routing.RegisterPublisher(typeof(IMyEvent).Assembly, “Accounts”);
<endpoints>
<endpoint name="Accounts">
<instance machine="MyVM"/>
</endpoint>
</endpoints>
That said, I do see a reference to a “queue” option in this doc: Mapping Endpoint Instances With a Shared File • NServiceBus Samples • Particular Docs
<endpoints>
<endpoint name="Accounts">
<instance machine="MyVM" queue="Accounts_QA"/>
</endpoint>
</endpoints>
Is this the correct way to do the equivalent of:
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MyAssembly" Endpoint="Accounts_QA@MyVM" />
</MessageEndpointMappings>
</UnicastBusConfig>
Thanks,
Phil