简体   繁体   English

Windows Service Bus消息消失

[英]Windows Service Bus messages disappearing

I have a case of disappearing messages. 我有一个消失的消息的情况。 I have the following implementation of Service Bus: 我具有以下服务总线的实现:

BrokeredMessage msg = new BrokeredMessage(messageContent);
msg.TimeToLive = messageLiveTime;

queueClient.SendAsync(message);

// Later

var messageOptions = new OnMessageOptions() {MaxConcurrentCalls = maxConcurrentCallsToCallBack};
client.OnMessage((incomingMessage) =>
{
    T content = CommonServiceBus.ExtractMessageContent<T>(incomingMessage);

    if (content != null)
    {
       callBack(content); 
    }
}, messageOptions);

I have 3 MaxConcurrentCalls, and the message TTL is 12 hours; 我有3个MaxConcurrentCalls,消息TTL为12小时; however, I send about 10 messages (each take about 30 seconds to complete) the first 9 or so get processed but the 10th is never received. 但是,我发送了大约10条消息(每条消息大约需要30秒才能完成),前9条消息得到处理,但第十条消息却从未收到。

Things I've tried: 我尝试过的事情:

  1. The messages are not being consumed by anyone else. 消息未被其他任何人使用。
  2. The messages are not expiring (at least their TTL is set correctly) 消息没有过期(至少正确设置了它们的TTL)

If I lower the MaxConcurrentCalls to 1 it gets worse. 如果我将MaxConcurrentCalls降低到1,则会变得更糟。 Something is consuming the messages (or the messages are expiring) but I have no idea where or how. 某些消息正在消耗消息(或消息即将到期),但我不知道在哪里或如何使用。

We ran into a similar issue and it turns out that the message TTL only is used if it is shorter than the container TTL. 我们遇到了类似的问题,事实证明,仅当消息TTL比容器TTL短时才使用。 Make sure you aren't setting the container TTL or set it to something bigger than the max message TTL you will use. 确保您未设置容器TTL或将其设置为大于将使用的最大消息TTL的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM