def send(message, server, queue=None, topic=None, producer=None):
    """
    Sends a message to the queue or topic passed as arguments

    :param message: Message to be sent in the kafka topic or the sqs queue
    :param server: Specified whether an SQS server (e.g: elasticMQ) or an Apache Kafka server will be used
    :param queue: SQS queue in which to send the message (if server='SQS')
    :param topic: Apache Kafka topic in which to send the message (if server='KAFKA')
    :param producer: Apache KAFKA producer, = None is not specified

    """
    if server == 'SQS':
        return queue.send_message(MessageBody=message)
    elif server == 'KAFKA':
        message_bytes = bytes(message.encode('utf-8'))
        if type(topic) == bytes:
            topic = topic.decode('utf-8')
        producer.send(topic, message_bytes)
        producer.flush()
