tags:

views:

30

answers:

2

Hi, How can I get the current inputqueue programatically in nServiceBus?

You can set it like this : Configure.Instance.Configurer.ConfigureProperty(t => t.InputQueue, yourDynamicQueue);

But how can i Get it ? (without programatically going through the app.config)

Please dont answer "why do you need that? etc..." -i got a scenario where i need it..

Thor Halvor

+1  A: 

You should be able to use the ConfigurationManager's GetSection method to get this straight out of the app.config (or web.config) file, casting the result to the type identified by the configSection entry.

David
Yes this is my "last" option if there isnt directly support for it
ThorHalvor
+1  A: 

Take a dependency to MsmqTransport and access it through the InputQueue property

Andreas
Do you have an example doing that ?
ThorHalvor
This code is doing just that http://github.com/andreasohlund/NSBManager/blob/master/src/NSBManager.Instrumentation.Core/Inspectors/Transport/MsmqTransportInspector.cs
Andreas
Nice, the whole NSBManager thing look promising :) tnx
ThorHalvor