When trying to add a message to an Azure Service Bus Queue, Sometimes I'm getting this error. Can anyone please explain why this happens?
The setup is, We have an Azure durable function that invokes an activity function. That activity function adds this message to the queue.
Here's how we do the queuing.
public async Task SendWithDelayAsync<T>(T obj, TimeSpan delayProcessing, string sessionId = null) where T : BaseQueueMessage
{
string messageBody = JsonConvert.SerializeObject(obj);
var message = new Message(Encoding.UTF8.GetBytes(messageBody));
if (!string.IsNullOrEmpty(sessionId))
{
message.SessionId = sessionId;
}
// Send the message to the queue.
await _queueClient.ScheduleMessageAsync(message, DateTime.Now.Add(delayProcessing));
}
Thanks!