tags:

views:

48

answers:

1

I can use this code to get the return address.

string returnAddress = Bus.CurrentMessageContext.ReturnAddress;

But how do i get the "to address" of the message. i.e. the Queue that NServiceBus pulled the message from.

I had a look through the source and it seems Bus.Transport.Address is what i want but there is no get on Transport

Note: I am within the "Handle" method of a message handler.

A: 

Seems i just get it injected by adding a property

public ITransport Transport { get; set; }

And then accessing

Transport.Address

NOTE: turns out that in the latest source there is no property "Address" on ITransport. So this answer is not correct :(

https://nservicebus.svn.sourceforge.net/svnroot/nservicebus/trunk/src/unicastTransport/NServiceBus.Unicast.Transport/ITransport.cs

Simon