tags:

views:

15

answers:

1

For one of my Subscriber MTs, I need to have multiple implementations of IHandleEvents, as well as allow 3rd parties to specify their own implementations. At application startup, I would like to be able to scan the directory and the config to determine which implementation to use, and then register it to be used for all incoming messages. Is this possible? Would I somehow register the type? Or would I register an instance? Or maybe a Func so that I could decide in the func whether to provide a new instance everytime or re-use?

+1  A: 

I assume you mean IHandleMessages<T> - if you don't want NServiceBus to scan and register the types it finds automatically, you can use Configure.With(types) or Configure.With(assemblies) to limit the types NServiceBus will use.

Udi Dahan