|
@@ -9,11 +9,9 @@ class MQ:
|
|
|
instance_id = "MQ_INST_1894469520484605_BXhXuzkZ"
|
|
|
|
|
|
def __init__(self, topic_name) -> None:
|
|
|
- self.mq_client = MQClient(
|
|
|
- "http://1894469520484605.mqrest.cn-qingdao-public.aliyuncs.com",
|
|
|
- "LTAI4G7puhXtLyHzHQpD6H7A", "nEbq3xWNQd1qLpdy2u71qFweHkZjSG")
|
|
|
- self.producer = self.mq_client.get_producer(self.instance_id,
|
|
|
- topic_name)
|
|
|
+ self.mq_client = MQClient("http://1894469520484605.mqrest.cn-qingdao-public.aliyuncs.com", "LTAI4G7puhXtLyHzHQpD6H7A",
|
|
|
+ "nEbq3xWNQd1qLpdy2u71qFweHkZjSG")
|
|
|
+ self.producer = self.mq_client.get_producer(self.instance_id, topic_name)
|
|
|
|
|
|
def send_msg(self, video_dict):
|
|
|
strategy = video_dict["strategy"]
|
|
@@ -22,9 +20,7 @@ class MQ:
|
|
|
msg = TopicMessage(json.dumps(video_dict))
|
|
|
msg.set_message_key(strategy + "-" + video_dict["out_video_id"])
|
|
|
re_msg = self.producer.publish_message(msg)
|
|
|
- Common.logger(strategy, platform).info(
|
|
|
- "Publish Message Succeed. MessageID:%s, BodyMD5:%s" %
|
|
|
- (re_msg.message_id, re_msg.message_body_md5))
|
|
|
+ Common.logger(strategy, platform).info("Publish Message Succeed. MessageID:%s, BodyMD5:%s" %
|
|
|
+ (re_msg.message_id, re_msg.message_body_md5))
|
|
|
except MQExceptionBase as e:
|
|
|
- Common.logger(strategy, platform).error(
|
|
|
- "Publish Message Fail. Exception:%s" % e)
|
|
|
+ Common.logger(strategy, platform).error("Publish Message Fail. Exception:%s" % e)
|