code: def stop_consumer(self):
          
          try:
              LOGGER.info('Shutting down the consumer')
              self.consumer.shutdown()
          except AttributeError:
              LOGGER.debug('Consumer does not have a shutdown method')
docs: Stop the consumer object and allow it to do a clean shutdown if it
          has the ability to do so.