title: Monitoring SignalR message sizes
body: <p>I am aware of a potential performance issue with SignalR when messages exceed 32K in size, what I would like to do is extend SignalR's normal process to check messages sizes and log if they exceed the 32K cutoff. I am trying to do so by registering custom types inheriting from SignalR's own types as documented here: <a href="https://github.com/SignalR/SignalR/wiki/Extensibility" rel="nofollow noreferrer">https://github.com/SignalR/SignalR/wiki/Extensibility</a> however the expected methods are not being hit when objects are pushed to clients from the server. Am I doing something wrong or is there an alternate way to monitor for objects exceeding the 32K size?</p>
  
  <pre><code>    public class MessageBusWithChecking : MessageBus
      {       
          public MessageBusWithChecking(IDependencyResolver resolver) : base(resolver)
          {
  
          }
  
          //This method is never hit
          public override Task Publish(Message message)
          {
              var messageSize = message.Value.Count();
  
              const int mem32K = 1024 * 32;
              if (messageSize &gt; mem32K)
              {
                  //Do Logging here
              }
  
              return base.Publish(message);
          }
      }
  
  //App startup code...
  public class Startup
      {
      public void Configuration(IAppBuilder app)
          {
              ...
              //Register custom class
              GlobalHost.DependencyResolver.Register(typeof(IMessageBus), () =&gt; new MessageBusWithChecking(GlobalHost.DependencyResolver));
              ...
          }
      }
  </code></pre>
  
  <p>I also attempted the same process as above with "IJsonSerializer" to no results as well.</p>