Esempio n. 1
0
def build(message_data, message_group_id=None):
    data = json.dumps(message_data, sort_keys=True)
    msg = {"Id": hash(data), "MessageBody": data}
    if message_group_id:
        msg["MessageGroupId"] = str(message_group_id)
    return msg
Esempio n. 2
0
def build(record_data):
    data = json.dumps(record_data, sort_keys=True)
    return {"Data": data, "PartitionKey": utils.hash(data)}
Esempio n. 3
0
def test_kinesis_hash():
    hash = utils.hash(json.dumps({"foo": "bar"}, sort_keys=True))
    assert isinstance(hash, str) and len(hash) > 0