我遇到Azure Service总线的间歇性问题.偶尔,在总线上放置一条消息会导致以下异常:
TYPE:InvalidOperationException
消息:由于已经消耗了代理消息"723eab13dab34351a78bb687d0923b89",因此无法执行操作.请使用新的BrokeredMessage实例进行操作.
堆栈跟踪
at Microsoft.ServiceBus.Messaging.MessagingUtilities.ValidateAndSetConsumedMessages(IEnumerable`1 messages)
at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout)
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at IQ.IR.Core.ServiceBus.AzureBus`1.Enqueue(T message) in c:\BuildAgent\work\cc0c51104c02a4e9\IQ.IR.Core\ServiceBus\AzureBus.cs:line 69
...Rest of stacktrace snipped as it's within my app
Run Code Online (Sandbox Code Playgroud)
AzureBus的违规代码是:
public void Enqueue(T message)
{
using (var brokeredMessage = new BrokeredMessage(message) { Label = message.GetType().FullName, TimeToLive = _timeToLive })
{
_retryPolicy.ExecuteAction(() => _sender.Send(brokeredMessage));
}
}
Run Code Online (Sandbox Code Playgroud)
传入T消息的地方是
[Serializable]
public class ValidationMessage
{
public string ValidationToken { get; set;}
}
Run Code Online (Sandbox Code Playgroud)
_retryPolicy是一个
RetryPolicy<ServiceBusTransientErrorDetectionStrategy>
Run Code Online (Sandbox Code Playgroud)
_timeToLive是12小时的时间跨度
有任何想法吗?
我对使用Azure Service Bus通知中心感兴趣.但是,我的第一个"客户端"将是一个基于websocket的连接到具有Knockout的ASP.NET MVC站点.目前,我正在尝试使用SignalR将通知推送给客户端.
但是,如果我可以使用SB通知中心,这看起来会容易得多.所有 示例都是Windows或iOS.
您可以将Azure Service Bus通知中心与基于WebSocket的HTML客户端一起使用吗?
我在监测和固定的消息编写功能dead letter queue的topic subscription在Azure上.
我可以得到一个_subscriptionClient.PeekBatch(10)用于显示的消息列表; 但是,当我们想要实际删除其中一条消息时,我们会陷入困境.
工作流程将是:
.Complete().问题是,虽然我们有消息列表,但我们不能先.Complete()使用特定的消息.subscriptionClient.Receive().
由于你不能通过.Receive()MessageId发送消息,这是否意味着我们必须逐个遍历消息,如下所示?
public BrokeredMessage GetMessageById(string messageIdentifier)
{
BrokeredMessage matchingMessage = null;
var messageNotFound = true;
var messagesToAbandon = new List<BrokeredMessage>();
while (messageNotFound)
{
var message = _subscriptionClient.Receive();
if (message == null)
{
throw new Exception("Could not find the message on the queue");
}
if (message.MessageId == messageIdentifier)
{
messageNotFound = false;
matchingMessage = message;
}
else …Run Code Online (Sandbox Code Playgroud) 我想找到一种方法来确保我的自托管Web服务通过HTTPS连接到Azure Service Bus(主题和队列) - 我不希望它们回退到HTTP.
// this ensures that HTTP is used instead of TCP sockets.
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;
Run Code Online (Sandbox Code Playgroud)
以上设置确保不尝试TCP套接字,但我无法找到任何方法来确保在设置HTTPS(SSL)失败时不使用HTTP回退.
我的代理停止了fiddler与服务总线的良好协作,所以当我调出fiddler它只记录从我的服务器发出的一堆(未加密的)HTTP流量 - 显然这与我想要的相反.
消息传递实体期望以形状传递URI
Endpoint=sb://somenamespace.servicebus.windows.net/; ...
Run Code Online (Sandbox Code Playgroud)
这阻止我指定的https:// ....有没有人知道如何以及在哪里可以禁止Service Bus使用未加密的通信?
有趣的是(不一致?),命名空间管理器似乎并不介意使用带有https的URL ...
var ns = NamespaceManager.CreateFromConnectionString(
"Endpoint=https://somenamespace.servicebus.windows.net/;..."
);
Run Code Online (Sandbox Code Playgroud)
更新#1:启动wireshark,看起来通信是通过端口80.它使用http 1.1流,这解释了为什么fiddler和代理不能很好地播放.握手发生在azure在201响应中发送webstream地址,然后TCP数据包开始通过端口80传递,包括清除信息,如下所示:
*sb://somenamespace.servicebus.windows.net:80/....application/ssl-tls
...
(later on)
...
http://www.microsoft.com/pki/mscorp/MSIT%20Machine%20Auth%20CA%202(1).crt
Run Code Online (Sandbox Code Playgroud)
这让我强烈怀疑TLS流量是通过端口80发送的 - 尽管我希望有人能够确认这一点.
我们有一个在Microsoft Azure云平台上运行的应用程序.某些组件之间的通信使用Service Bus进行.一切都运行正常,直到最近我们才开始获得以下类型的超时异常:
打电话的时候 QueueClient x.Send(...)
在[0]处重新抛出异常:位于Microsoft.ServiceBus.Messaging的Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult result)中的Microsoft.ServiceBus.Common.AsyncResult.End [TAsyncResult](IAsyncResult结果) Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)中的.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.b__4(RequestAsyncResult thisPtr,IAsyncResult r)
打电话的时候 NamespaceManager x.GetQueue(...)
PROGRESS队列处理失败.System.TimeoutException:请求在60000毫秒后超时.无法确定请求的成功完成.应进行其他查询以确定操作是否成功.TrackingId:bdffb6bd-5367-4573-aaa3-8ea9a03f5a2b,TimeStamp:5/28/2015 8:39:46 AM ---> System.Net.WebException:请求已中止:请求已取消.在
Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult结果)的Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.GetAsyncResult`1.b__49(GetAsyncResult`1 thisPtr,IAsyncResult r)上的System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)处)
打电话的时候 NamespaceManager x.SubscriptionExists(...)
执行定期工作的异常:System.TimeoutException:请求在00:10:00毫秒后超时.无法确定请求的成功完成.应进行其他查询以确定操作是否成功.服务器堆栈跟踪:在[0]处重新抛出异常:位于Microsoft.ServiceBus.NamespaceManager.SubscriptionExists(String)上的Microsoft.ServiceBus.NamespaceManager.OnEndSubscriptionExists(IAsyncResult结果)中的Microsoft.ServiceBus.Common.AsyncResult.End [TAsyncResult](IAsyncResult结果) topicPath,String name)...
打电话的时候 QueueClient x.Receive(...)
PROGRESS队列处理失败.Microsoft.ServiceBus.Messaging.MessagingCommunicationException:与Service Bus通信期间出错.检查连接信息,然后重试.---> System.ServiceModel.CommunicationObjectFaultedException:内部服务器错误:服务器没有提供有意义的回复; 这可能是由于过早的会话关闭造成的.TrackingId:04ba0220-0350-4806-9c65-c2bba9671054,时间戳:28.05.2015 13:00:55服务器堆栈跟踪:异常重新抛出[0]:Microsoft的Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(异常异常). Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult)上的Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult result)中的ServiceBus.Common.AsyncResult.End [TAsyncResult](IAsyncResult结果)结果)Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.b__4(RequestAsyncResult thisPtr,IAsyncResult r)at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)....
例外与ServiceBus明显相关,并且它们是非确定性的.把他们的功能,例如Send,GetQueue,SubscriptionExists,被称为不超过每分钟100-120次.我们在代码中没有改变任何内容,并且增加超时值(即使是非常高的值,比如10分钟)也无济于事.此外,我们不相信它是一些与网络相关的问题(在我们这边),因为当应用程序从不同的地方运行时会发生同样的错误.
最近有没有其他人遇到过这种例外情况?微软是否存在问题,或者我们遗漏了什么?
我有C#控制台应用程序,通过它我经常将数据发送到事件中心.这个控制台应用程序基本上从SQL存储读取一些数据并开始将数据推送到事件中心.
整个程序以无限循环/方式运行,就像在控制中一样,只要它在SQL中接收任何数据,它就从那里提取数据并开始发送到事件中心.
但是有一刻我得到了这个错误.
"无法为当前会话或连接分配更多句柄.允许的最大句柄数为4999.请释放资源再试一次.在Microsoft.ServiceBus.Common ......
当我重新启动这个控制台应用程序时它工作正常.但我不知道为什么我得到这个错误.
请帮我.
感谢和问候,
RK
我正在使用Azure Service Bus主题机制.我已将消息发送到主题,并希望查看全部发送到azure门户中主题的消息.我可以看到消息计数但想要查看实际消息而不是计数.
我怎样才能做到这一点?
根据此处的Azure ServiceBus 文档:
ServiceBusReceiver 类定义用于从 Azure 服务总线队列或主题订阅接收消息的高级接口。消息接收的两个主要通道是 receive(),用于发出单个消息请求,以及
async for message in receiver:以持续的方式连续接收传入消息。
我一直在尝试使用async for message in receiver:建议在每次出现消息时触发函数,但我不确定如何正确执行,因为我几乎没有使用异步函数的经验。熟悉异步/服务总线的人可以解释一下代码应该如何格式化吗?
编辑:让我提供更多背景信息。我正在创建一个 python Flask 服务,在启动时,我需要它开始监听主题/订阅名称上的消息。每当它收到消息时,它都会执行一些代码,然后发回消息。那么...如何在启动时启动异步侦听器,并让它在触发时执行一些代码?它还应该能够以非阻塞的方式处理每条消息。因此,如果同时收到两条消息,则应同时处理两条消息。
注意:我无法使用 Azure Functions。
python asynchronous azure azureservicebus azure-servicebus-topics
我正在研究服务总线主题触发功能。我们已经使用了消费计划。据观察,该函数在不活动后进入睡眠状态,并且当有关于主题的新消息时它不会唤醒。
功能是使用arm模板使用管道部署的,部署后我们不会进行任何更改。
同一问题在多次讨论中得到讨论。
https://github.com/Azure/Azure-Functions/issues/229
可能的解决方案位于以下位置。 https://github.com/Azure/Azure-Functions/issues/210
但不确定这里作为开发人员需要做什么。有人可以帮忙吗?
azureservicebus .net-core azure-servicebus-topics azure-functions
有谁知道这个错误代表什么?我们目前正在使用Azure Service Bus,并试图理解它的含义。
Microsoft.Azure.WebJobs.Script.HostDisposeException:主机已处置且无法使用。处置对象:'Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection.ScopedResolver';在堆栈跟踪中找到 IListener:'Microsoft.Azure.WebJobs.ServiceBus.Listeners.ServiceBusListener
azureservicebus ×10
azure ×8
.net-core ×2
c# ×2
.net ×1
asynchronous ×1
python ×1
servicebus ×1
timeout ×1