This method closes the connection to RabbitMQ.

def close_connection(self):
        """This method closes the connection to RabbitMQ."""
        self._logger.info('Closing connection')
        self._closing = True
        self._connection.close()