RabbitMQ.轨道交通.虚拟主机. [英] RabbitMQ. Masstransit. Virtual Hosts.
本文介绍了RabbitMQ.轨道交通.虚拟主机.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从masstransit服务总线配置中创建虚拟主机?
how can I create virtual host from masstransit service bus configuration?
例如,我的意思是我将我的应用程序部署到了新的PC上,它应该为其自身创建新的虚拟主机.
I mean, for example, I deployed my app to some new PC and it should create new virtual host for itself.
我正在尝试这样做:
var bus = ServiceBusFactory.New(sbc =>
{
sbc.UseRabbitMq();
sbc.UseHealthMonitoring(10);
sbc.ReceiveFrom("rabbitmq://localhost:5672/mynewcustomvhost/myqueue?temporary=true");
});
但是出现错误:
"No Obvious Problems says ConfigurationResult"
为什么呢?
推荐答案
尝试一下:
ServiceBusFactory.New(sbc =>
{
sbc.UseRabbitMq(r =>
{
r.ConfigureHost(new Uri("rabbitmq://hostname/vhost/queue"), h =>
{
h.SetUsername("username");
h.SetPassword("password");
});
});
// other options
});
这篇关于RabbitMQ.轨道交通.虚拟主机.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文