def add_message_to_queue(self, payload, **attributes):
        """ Given a payload (a dict) and any optional message attributes (also a dict), add it to the queue. """

        return self.queue.send_message(MessageBody=json.dumps(payload),
                                       MessageAttributes={k: {"StringValue": v} for k, v in attributes.items()})
Given a payload (a dict) and any optional message attributes (also a dict), add it to the queue.