3

我正在使用代碼段將消息發送到服務總線主題中。該操作未在00:01:00分配的超時內完成

 try 
     { 
      // sb is instance of ServiceBusConfig.GetServiceBusForChannel 
      await sb.SendAsync(message); 
     } 
     catch (Exception ex) 
     { 
      this.logger.LogError(
       "chanel", 
       "An error occurred while sending a notification: " + ex.Message, 
       ex); 
      throw; 
     } 

和實施

public async Task SendAsync(BrokeredMessage message) 
    { 
     if (this.topicClient == null) 
     { 
      this.topicClient = TopicClient.CreateFromConnectionString(this.primaryConnectionString, this.topicPath); 
      this.topicClient.RetryPolicy = this.retryPolicy; 
     } 

     await this.topicClient.SendAsync(message); 
    } 

錯誤: -

"ErrorCode,12005,Message,""An error occurred while sending a notification: The operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. For more information on exception types and proper exception handling, Exception,""Microsoft.ServiceBus.Messaging.MessagingException: The operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.

有關的異常類型處理

+0

您確定您將郵件發送到正確的服務,並且該服務正在接受來自外部的郵件? – McBoman

+0

是的..這個問題有時不是每天都會發生的。 –

+0

該消息是否有時超過256KB的限制? – McBoman

回答

1

更多的信息和適當的異常出現這種情況偶爾。 Azure可以改變和改變他們的基礎硬件。這些錯誤隨時都會出現。只要您在適當的地方有適當的重試邏輯,郵件將最終通過...

相關問題