How To Specify Your Input Queue Name?

When using the NServiceBus.Host.exe

Namespace convention

When using NServiceBus.Host, the namespace of the class implementing IConfigureThisEndpoint will be used as the endpoint name as the default convention. In the following example, the endpoint name when running NServiceBus host becomes MyServer. This is the recommended way to name a endpoint. Also this emphasizes convention over configuration approach.

namespace MyServer
{
    public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
    {
        // ... your custom config

EndpointName attribute

You can set the endpoint name using the [EndpointName] attribute on your endpoint configuration. NOTE: This will only work when using NServiceBus host.

[EndpointName("MyEndpointName")]
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server
{
    // ... your custom config

Installation parameter

If you specify a explicit service name when installing the NServiceBus host, this is used as the endpoint name: /serviceName:"MyEndpoint".

Command-line parameter

You can specify a endpoint name when running the NServiceBus host: /endpointName:"MyEndpoint".

When using the fluent API

NOTE: these approaches can also be used from NServicebus Host via the use of IConfigureThisEndpoint.

You can define your own convention in the endpoint initialization code using this

Version 5

var configuration = new BusConfiguration();

configuration.EndpointName("MyEndpoint");

Version 4

Configure.With()
    .DefineEndpointName("MyEndpoint");


Last modified 2014-09-01 07:48:56Z