使用 RabbitMQ 在 NServiceBus 中设置自动删除和独占属性

有谁知道如何在 NServiceBus 中为 RabbitMq 队列设置自动删除和独占?


我尝试了以下但它不起作用:


        protected override void OnConfigurationStarting(EndpointConfiguration configuration, ContainerBuilder builder,

        Assembly[] assemblies, TransportExtensions<RabbitMQTransport> transport)

    {

        transport.GetSettings().Set("exclusive", true);

        transport.GetSettings().Set("autodelete", true);


        configuration.PurgeOnStartup(true);

        configuration.DisableFeature<TimeoutManager>();

        configuration.LimitMessageProcessingConcurrencyTo(40);

        configuration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();

        configuration.UsePersistence<InMemoryPersistence, StorageType.Subscriptions>();


        transport.UseConventionalRoutingTopology();

        transport.ConnectionString(EndpointSettings.BusConnectionString);


        var recoverability = configuration.Recoverability();


        recoverability.Delayed(x =>

        {

            x.NumberOfRetries(0);

        });


        recoverability.Immediate(x =>

        {

            x.NumberOfRetries(0);

        });


        _bootstrapperWithMessaging.OnConfigurationStarting(configuration, builder, assemblies);

    }


largeQ
浏览 107回答 1
1回答

米琪卡哇伊

NServiceBus RabbitMQ 传输不支持这些设置。
打开App,查看更多内容
随时随地看视频慕课网APP