title: NServiceBus: How do I configure different message handlers to handle messages from different endpoints in MessageEndpointMappings
body: <p>I have few message handlers (IHandleMessage) handling different messages in a project. The messages are not consumed by handlers from different endpoints. They are consumed from the endpoint mentioned in the EndpointConfig or from the endpoint with the name same as the namespace of the project. How can I have handlers consuming messages as per set of endpoints defined in MessageEndpointMappings section?</p>
  
  <p>For example, I have two message types. Message1 and Message 2 in project Contracts and two handlers (IHandleMessage), Message1Handler and Message2Handler in project Handlers.</p>
  
  <p>I am using RabbitMq transport of the NServiceBus.
  I want these handlers to consume messages from their respective message queues, i.e. Message1Handler from Contracts.Message1 queue and Message2Handler from Contracts.Message2 queue.</p>
  
  <pre><code>&lt;MessageEndpointMappings&gt;
        &lt;add Assembly="Contracts" Type="Contracts.Message1" Endpoint="Contracts.Message1" /&gt;
        &lt;add Assembly="Contracts" Type="Contracts.Message2" Endpoint="Contracts.Message2" /&gt;
    &lt;/MessageEndpointMappings&gt;
  </code></pre>
  
  <p>These endpoint mappings in Handler project does not work. The messages are not consumed. The messages are either consumed from Handler queue (same as namespace of the project) or <em>EndpointName</em> mentioned in the EndpointConfig.cs.</p>
  
  <p>What is the use of MessageEndpointMappings in case of handlers?</p>
  
  <p><em>I am using NServiceBus 5.2.0</em></p>