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?
For example, I have two message types. Message1 and Message 2 in project Contracts and two handlers (IHandleMessage), Message1Handler and Message2Handler in project Handlers.
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.
<MessageEndpointMappings>
<add Assembly="Contracts" Type="Contracts.Message1" Endpoint="Contracts.Message1" />
<add Assembly="Contracts" Type="Contracts.Message2" Endpoint="Contracts.Message2" />
</MessageEndpointMappings>
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 EndpointName mentioned in the EndpointConfig.cs.
What is the use of MessageEndpointMappings in case of handlers?
I am using NServiceBus 5.2.0