有几天我们的Azure服务总线出现了问题。我们的serviceBuses(40个)都没有响应,重新启动时无法连接并回复
[System.IdentityModel.Tokens.SecurityTokenException] = {"令牌提供商在访问' https://XYZ-sb.accesscontrol.windows.net/WRAPv0.9/时无法提供安全令牌。令牌提供商返回了消息:'请求已中止:请求已取消。'。"}
所有证书,秘密和密钥都经过检查并发现正确。
var tcpBinding = new NetTcpRelayBinding
{
ConnectionMode = (TcpRelayConnectionMode)int.Parse("1"), //TcpRelayConnectionMode.Hybrid =1,
MaxReceivedMessageSize = int.Parse("20000000"),
MaxBufferSize = int.Parse("20000000"),
MaxBufferPoolSize = int.Parse("20000000"),
ReaderQuotas = new XmlDictionaryReaderQuotas
{
MaxDepth = int.Parse("32"),
MaxArrayLength = int.Parse("20000000"),
MaxStringContentLength = int.Parse("20000000"),
},
};
tcpBinding.Security.Mode = (EndToEndSecurityMode)int.Parse("0"); //EndToEndSecurityMode.None =0
//if you change how the license is used you have to change it in the worker role too.
System.Net.ServicePointManager.DefaultConnectionLimit = int.Parse("200");
_serviceHost.AddServiceEndpoint(
typeof(IMessage),
tcpBinding,
new Uri("sb://XYZ.servicebus.windows.net/xyzabc")
).Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider("owner", "myFantasticSecret") });
_serviceHost.Open();
有谁知道这里可能存在什么问题?
我们最近增加了11条新服务总线,并重新启动了我们能想到的一切。
更新
为tcp绑定添加了超时。
OpenTimeout = new TimeSpan(0,2,0),
CloseTimeout = new TimeSpan(0,0,2,0),
SendTimeout = new TimeSpan(0,0,2,0),
ReceiveTimeout = new TimeSpan(0,0,2,0),
20秒后仍然会超时。