问题
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();
}
来源:https://stackoverflow.com/questions/4810164/nservicebus-how-to-not-create-queues-automatically