我尝试按照Microsoft 文档中提到的步骤设置第二个 ServiceBus 以防止 ServiceBus 中断。
但是,当我运行下面的代码时,配对永远不会完成:
public class ServiceBusContext
{
public ServiceBusContext()
{
var nsManager1 = NamespaceManager.CreateFromConnectionString("...");
var messageFactory1 = MessagingFactory.Create(nsManager1.Address, nsManager1.Settings.TokenProvider);
var nsManager2 = NamespaceManager.CreateFromConnectionString("...");
var messageFactory2 = MessagingFactory.Create(nsManager2.Address, nsManager2.Settings.TokenProvider);
var sendAvailabilityOptions = new SendAvailabilityPairedNamespaceOptions(nsManager2, messageFactory2, 10, TimeSpan.Zero, false);
messageFactory1.PairNamespaceAsync(sendAvailabilityOptions).Wait();
Debug.WriteLine("Cannot reach this code");
}
}
如何正确设置具有故障转移功能的 ServiceBuse?
蝴蝶不菲
相关分类