code: def on_consumer_cancelled(self, method_frame):
          
          logger.debug('Consumer was cancelled remotely, shutting down: %r', method_frame)
          if self._channel:
              self._channel.close()
docs: Invoked by pika when RabbitMQ sends a Basic.Cancel for a consumer
          receiving messages.
  
          :param pika.frame.Method method_frame: The Basic.Cancel frame