【发布时间】:2017-03-10 19:38:30
【问题描述】:
我正在尝试托管 NServicebus 的 2 个端点,指向 2 个不同的队列并将消息发送到这 2 个队列。 出于某种奇怪的原因,它不起作用。 我用谷歌搜索,在某些地方人们说这是可能的,在其他地方:不可能。
这是我的代码,适用于单个端点:
//Here I configure the endpoint
var endpointConfiguration = new EndpointConfiguration(endpointName: Queue1);
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
_endpointInstance = await Endpoint.Start(endpointConfiguration).ConfigureAwait(false);
//Here I send a command
_endpointInstance.Send(Queue1, command);
但是如果我使用新端点的另一个变量复制粘贴此代码,例如 _endpointInstance2(意味着:我使用相同的代码来实例化新端点),应用程序就会崩溃
【问题讨论】:
-
请发布您尝试做的完整代码。
-
你应该也在等待发送.. :)
标签: c# messaging nservicebus