title: How many subscribe are allowed in StackExchange.Redis.ISubscriber.Subscribe
body: <p>ISubscriber.Subscribe terminate abruptly when too many subscription are requested and there are no exception or so to understand what was happening or to check on How many subscription are allowed?</p>
  <ol>
  <li>Incase of too many subscrption this program terminate abruptly without any exception?</li>
  <li>does StackExchange.Redis.ISubscriber.Subscribe  any limitation for subscription?</li>
  <li>is there any do's &amp; don'ts</li>
  </ol>
  <p>here is my code for pub &amp; sub</p>
  <pre><code>    public class Subscriber
      {
          static Timer _timer = null;
          static long batchNumber = 0;
          static Subscriber subscriber;
          public static void Main(string[] args)
          {
              try
              {
                  _timer = new Timer(async (obj) =&gt; await StartIncrement(obj), null, 500, Timeout.Infinite);
                  subscriber = new Subscriber();
                  RedisWrapper.Instance.Ip = &quot;127.0.0.1&quot;;
                  RedisWrapper.Instance.Port = 6379;
                  RedisWrapper.Instance.Init();
                  subscriber.StartSubscribe();            
              }
              catch(Exception e)
              {
                  Console.WriteLine(e.Message);
              }
              Console.ReadKey();
          }
      
          private static async Task StartIncrement(object obj)
          {
              batchNumber++;
              subscriber.StartSubscribe();
              _timer?.Change(500, Timeout.Infinite);
          }
      
          public void StartSubscribe()
          {
              try
              {
                  Console.WriteLine($&quot;Subscribing to chennal TESTPUBSUB{batchNumber}&quot;);
                  GetSubscriber().Subscribe(&quot;TESTPUBSUB&quot; + batchNumber).OnMessage((msg) =&gt; OnDataReceive(msg)); ;
              }
              catch(Exception e)
              {
                  Console.WriteLine(e.Message);
              }
              
          }
      
          private void OnDataReceive(ChannelMessage msg)
          {
              var message = msg.Message;
              Console.WriteLine(JsonConvert.DeserializeObject&lt;JObject&gt;(message)[&quot;batchnumber&quot;]);
  GetSubscriber().Unsubscribe(&quot;TESTPUBSUB&quot; + JsonConvert.DeserializeObject&lt;JObject&gt;(message)[&quot;batchnumber&quot;]);
          }
      
          private ISubscriber GetSubscriber()
          {
              return RedisWrapper.Instance.Connection.GetSubscriber();
          }
      }
  </code></pre>
  <p>Publisher code</p>
  <pre><code>public class Publisher
  {
      public static void Main(string[] args)
      {
  
          Publisher publisher = new Publisher();
          RedisWrapper.Instance.Ip = &quot;127.0.0.1&quot;;
          RedisWrapper.Instance.Port = 6379;
          RedisWrapper.Instance.Init();
          publisher.StartPubliser();
          Console.ReadKey();
      }
  
      Timer _timer;
      public void StartPubliser()
      {
          _timer  = new Timer(async (obj) =&gt; await StartPublish(obj), null, 550, Timeout.Infinite);
      }
  
      long batchNumber;
      private async Task StartPublish(object obj)
      {
          batchNumber++;
          try
          {
              GetSubscriber().Publish(&quot;TESTPUBSUB&quot; + batchNumber, JsonConvert.SerializeObject(new { batchnumber = batchNumber, data = &quot;Some message&quot;)}) );
              
          }
          catch(Exception e)
          {
              Console.WriteLine(e.Message);
          }
          Console.WriteLine($&quot;Published  Batch {batchNumber}&quot;);
          _timer?.Change(550, Timeout.Infinite);
      }
  
      private ISubscriber GetSubscriber()
      {
          return RedisWrapper.Instance.Connection.GetSubscriber();
      }
  }
  </code></pre>