有谁知道如何在 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);
}
米琪卡哇伊
相关分类