简体   繁体   中英

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; 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.

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)

If I lower the MaxConcurrentCalls to 1 it gets worse. 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. Make sure you aren't setting the container TTL or set it to something bigger than the max message TTL you will use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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