title: Azure Servicebus: Transient Fault Handling
body: <p>I have a queue receiver, which reads messages from the queue and process the message (do some processing and inserts some data to the azure table or retrieves the data).</p>
  
  <p>What I observed was that any exception that my processing method (<code>SendResponseAsync()</code>) throws results in retry i.e. redelivery of the message to the default 10 times.</p>
  
  <p>Can this behavior be customized i.e. I only retry for certain exception and ignore for other. Like if there is some network issue, then it makes sense to retry but if it is <code>BadArgumentException(poisson message)</code>, then I may not want to retry.</p>
  
  <p>Since retry is taken care by <code>ServiceBus</code> client library, can we customize this behavior ?</p>
  
  <p>This is the code at the receiver end</p>
  
  <pre><code>public MessagingServer(QueueConfiguration config)
  {
        this.requestQueueClient = QueueClient.CreateFromConnectionString(config.ConnectionString, config.QueueName);
        this.requestQueueClient.OnMessageAsync(this.DispatchReplyAsync);
  }
  
  private async Task DispatchReplyAsync(BrokeredMessage message)
  {
       await this.SendResponseAsync(message);
  }
  </code></pre>