英文:
Creating Quorum queue with ha-mode=all
问题
抱歉,我需要翻译的部分如下:
"I want to apologize in advanced, but I am not very experienced with MassTransit.
I need help creating quorum queue and set "ha-mode" of the queue to "all" for MassTransit 8.0.15
My code is:
services.AddMassTransit(mt =>
{
mt.AddConsumer(typeof(FileConsumer))
.Endpoint(e => { e.Name = "my-queue"; e.InstanceId = ""; });
mt.UsingRabbitMq((context, rmq) =>
{
rmq.Host(rabbitMqHost, host =>
{
host.Username(userName);
host.Password(password);
});
rmq.ConfigureEndpoints(context);
});
});
Any help will be appreciated. Thanks
I tried with adding:
rmq.SetQueueArgument("x-queue-type", "quorum");
rmq.SetQueueArgument("x-ha-mode", "all");
but it didn't worked"
英文:
I want to apologize in advanced, but I am not very experienced with MassTransit.
I need help creating quorum queue and set "ha-mode" of the queue to "all" for MassTransit 8.0.15
My code is:
services.AddMassTransit(mt =>
{
mt.AddConsumer(typeof(FileConsumer))
.Endpoint(e => { e.Name = "my-queue"; e.InstanceId = ""; });
mt.UsingRabbitMq((context, rmq) =>
{
rmq.Host(rabbitMqHost, host =>
{
host.Username(userName);
host.Password(password);
});
rmq.ConfigureEndpoints(context);
});
});
Any help will be appreciated. Thanks
I tried with adding:
rmq.SetQueueArgument("x-queue-type", "quorum");
rmq.SetQueueArgument("x-ha-mode", "all");
but it didn't worked
答案1
得分: 0
我相信 ha-mode
仅适用于经典队列。Quorum 队列完全不同。您可以通过添加配置端点回调来配置接收端点以使用 Quorum 队列:
mt.AddConfigureEndpointsCallback((name, cfg) =>
{
if(cfg is IRabbitMqEndpointConfigurator rmq)
rmq.SetQuorumQueue();
});
英文:
I believe ha-mode
is only for classic queues. Quorum queues are completely different. You can configure receive endpoints to use quorum queues by adding a configure endpoints callback:
mt.AddConfigureEndpointsCallback((name, cfg) =>
{
if(cfg is IRabbitMqEndpointConfigurator rmq)
rmq.SetQuorumQueue();
});
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论