NServiceBus: Can it work with NO XML configuration?
I don't want to use any XML con开发者_开发问答figuration. 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.
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
精彩评论