docs: def on_message(self, unused_channel, basic_deliver, properties, body):
          """Called on receipt of a message from a queue.
  
          Processes the message using the self._process method or function and positively
          acknowledges the queue if successful. If processing is not succesful,
          the message can either be rejected, quarantined or negatively acknowledged,
          depending on the failure mode.
  
          : param basic_deliver: AMQP basic.deliver method
          : param properties: Message properties
          : param body: Message body
  
          : returns: None
  
          """
          if self.check_tx_id:
              try:
                  tx_id = self.tx_id(properties)
  
                  logger.info('Received message',
                              queue=self._queue,
                              delivery_tag=basic_deliver.delivery_tag,
                              app_id=properties.app_id,
                              tx_id=tx_id)
  
              except KeyError as e:
                  self.reject_message(basic_deliver.delivery_tag)
                  logger.error("Bad message properties - no tx_id",
                               action="rejected",
                               exception=str(e))
                  return None
              except TypeError as e:
                  self.reject_message(basic_deliver.delivery_tag)
                  logger.error("Bad message properties - no headers",
                               action="rejected",
                               exception=str(e))
                  return None
          else:
              logger.debug("check_tx_id is False. Not checking tx_id for message.",
                           delivery_tag=basic_deliver.delivery_tag)
              tx_id = None
  
          try:
              try:
                  self.process(body.decode("utf-8"), tx_id)
              except TypeError:
                  logger.error('Incorrect call to process method')
                  raise QuarantinableError
  
              self.acknowledge_message(basic_deliver.delivery_tag,
                                       tx_id=tx_id)
  
          except (QuarantinableError, BadMessageError) as e:
              # Throw it into the quarantine queue to be dealt with
              try:
                  self.quarantine_publisher.publish_message(body, headers={'tx_id': tx_id})
                  self.reject_message(basic_deliver.delivery_tag, tx_id=tx_id)
                  logger.error("Quarantinable error occured",
                               action="quarantined",
                               exception=str(e),
                               tx_id=tx_id)
              except PublishMessageError:
                  logger.error("Unable to publish message to quarantine queue. Rejecting message and requeuing.")
                  self.reject_message(basic_deliver.delivery_tag,
                                      requeue=True,
                                      tx_id=tx_id)
  
          except RetryableError as e:
              self.nack_message(basic_deliver.delivery_tag, tx_id=tx_id)
              logger.error("Failed to process",
                           action="nack",
                           exception=str(e),
                           tx_id=tx_id)
  
          except Exception as e:
              self.nack_message(basic_deliver.delivery_tag, tx_id=tx_id)
              logger.exception("Unexpected exception occurred")
              logger.error("Failed to process",
                           action="nack",
                           exception=str(e),
                           tx_id=tx_id)