سؤال

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top