Not creating queues automatically in NServiceBus

后端 未结 2 1036
广开言路
广开言路 2020-12-29 09:59

I\'m running NServiceBus 3.0.0 rc2 but when I start the application (as local admin) without pre-creating the MSMQ\'s it errors with :

The queue does

相关标签:
2条回答
  • 2020-12-29 10:15

    Installers are not run automatically when you self host. Please see the global.asax.cs in the asyncpages sample for a example on how to do it manually.

    using NServiceBus
    using NServiceBus.Installation.Environments
    ...
    Bus = Configure.With()
        .Log4Net()
        .DefaultBuilder()
        .XmlSerializer()
        .MsmqTransport()
        .IsTransactional(false)
        .PurgeOnStartup(false)
        .UnicastBus()
        .ImpersonateSender(false)
        .CreateBus()
        .Start(() => Configure.Instance.ForInstallationOn<Windows>().Install());
    
    0 讨论(0)
  • 2020-12-29 10:26

    I got around this by creating the queue on the client side manually (which is self hosted).

    Not sure, but I thought 2.x did this automatically. Host is creating the queues automatically, as expected, but not the client (self hosted).

    UPDATE: Like Andreas, senor guardo camino, stated, you need to call install manually like so;

    .Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());
    

    This will create the queues as expected.

    0 讨论(0)
提交回复
热议问题