NServiceBus: How to not create queues automaticall

2019-07-12 18:50发布

问题:

I really want to be able to prevent NSB from creating my queues automatically. I don’t like how it creates them with totally unrestricted permissions. Is this possible?

回答1:

You can provide your custom initialization code by implementing IWantCustomInitialization and specifying it in your code:

void IWantCustomInitialization.Init()
    {
        NServiceBus.Configure.With()
            .DefaultBuilder()
            .MsmqTransport()
            .DoNotCreateQueues()
            .XmlSerializer();
    }


标签: nservicebus