code: @Override
      public void doFilterWrite(final long sessionId, final long sessionWrittenBytes, final WriteRequest writeRequest) throws
              Exception {
          Object message = writeRequest.getMessage();
  
          if (message instanceof IoBuffer) {
              ThreadGatewayStats stats = gatewayStats.get();
              stats.doFilterWrite((IoBuffer) message);
          }
      }
docs: This must run ON the IO thread