tags:

views:

41

answers:

1

I don't want to use any XML configuration. Is it possible to have NServiceBus set up with NO XML configuration? I really want my publisher to be configured all in code, and I want to be able to specify everything from the transport to the serializer to the subscription storate explicitly in code.

+3  A: 

yes. take a look at this gist which has the code to do exactly this via a custom configuration source. it defaults to using config code if either is not used.

usage would be like such:

Configure.With()
    .CustomConfigurationSource(new UserConfigurationSource(
    unicast => {
        // unicast bus setup
    },
    msmq => {
       // msmq setup
    })
 // rest of code
Darren Kopp