Howto get local queue name inside IHandleMessages

nservicebus

(George) #1

We use NServiceBus v6.
I would like to know howto get local queue name inside IHandleMessages handler in the
public async Task Handle(IMessage message, IMessageHandlerContext context) method.


(Sean Feldman) #2

Hi George,

Given that handler is executing within the endpoint, you could have a component registered with NServiceBus container that would return the value used for EndpointConfiguration to set up endpoints’ name.

Please see more information on Depenedency Injection with NServiceBus and some samples to get your going.