[11.10.20] syncId generation

This commit is contained in:
andrewso 2020-10-12 14:01:51 +01:00
parent aeb332c15a
commit abd53bce27

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
import stomp
import os
import os, uuid
from src.utils.jsonLogger import log
@ -19,12 +19,19 @@ class keys():
def activeMQSender(message):
addr, port, mqUser, mqPass = keys().returnKeys()
syncId = uuid.uuid4()
log("Attempting Connection to Artemis...", 'INFO')
con = stomp.Connection([(addr, port)], auto_content_length=False)
con.connect( mqUser, mqPass, wait=True)
con.send("PricingSave", message, content_type="application/json", headers={"Content-Type":"application/json"})
con.send("PricingSave",
message,
content_type="application/json",
headers={
"Content-Type":"application/json",
"X-CRYPTO-Sync-ID":syncId
})
con.disconnect()