def send_message(self, message, queue_url):
    sqs = self.connect()
    if (queue_url is None):
        raise Exception('Queue name must be informed')
    queue_name = os.path.basename(queue_url)
    try:
        queue = sqs.get_queue_by_name(QueueName=queue_name)
        if (not isinstance(message, str)):
            try:
                message = json.dumps(message)
            except Exception as err:
                self.logger.error(err)
                message = str(message)
        response = queue.send_message(MessageBody=message)
    except Exception as err:
        self.logger.error(err)
        self.exception = err
        response = None
    return response
def send_message(self, message, queue_url):
    sqs = self.connect()
    if (queue_url is None):
        raise Exception('Queue name must be informed')
    queue_name = os.path.basename(queue_url)
    try:
        queue = sqs.get_queue_by_name(QueueName=queue_name)
        if (not isinstance(message, str)):
            try:
                message = json.dumps(message)
            except Exception as err:
                self.logger.error(err)
                message = str(message)
        response = queue.send_message(MessageBody=message)
    except Exception as err:
        self.logger.error(err)
        self.exception = err
        response = None
    return response