title: Azure Servicebus AutoDeleteOnIdle
body: <p>I'm trying to figure out the correct behavior when setting AutoDeleteOnIdle. I have a topic called MyGameMessages (not disclosing the game name since it might be considered advertisement).</p>
  
  <p>What I do is that I create a subscription on each node in my server farm.</p>
  
  <pre><code>var manager = GetNameSpaceManager();
  _subscriptionId = Guid.NewGuid().ToString();
  var description = new SubscriptionDescription(topic, _subscriptionId);
  description.AutoDeleteOnIdle = TimeSpan.FromHours(1);
  manager.CreateSubscription(description);
  </code></pre>
  
  <p>Then I start up a thread that pretty much loops for eternity (or at least until signaled to quit)</p>
  
  <pre><code>while(_running)
  {
      if (_subscriptionId == null)
          break;
  
      var message = client.Receive(TimeSpan.FromMinutes(1)); // MARK A
      if (message != null)
      {
          var body = message.GetBody&lt;T&gt;();
          // Do stuff with message
          message.Complete();
      }
  </code></pre>
  
  <p>} </p>
  
  <p>Question A:</p>
  
  <p>The first implementation had no timeout at MARK A. If no message is sent to this topic within one hour the subscription was autodeleted. Is this the behavior to expect? The client isn't really dead but I guess it just sits around waiting for a message. Is there no keep alive?</p>
  
  <p>Question B:</p>
  
  <p>Would it help to add the timeout as in MARK A or is it a better solution to create a new subscription every 50th minute (to create a small overlap just in case) and abandon the old one?</p>
  
  <p>Thanks</p>
  
  <p>Johan</p>