Open xianrenxiaomai opened 3 years ago
除了这个问题,sdk有不稳定的情况,mq中未消费积压的消息,会获取不到
+1
reference: https://github.com/aliyunmq/mq-http-python-sdk#notice MQClient, Producer, Consumer are not thread safe, please use multi instance in mutli thread. 要求这三个对象在线程中是单例的
Traceback (most recent call last): File "/Volumes/data/huifu/bff/saas_mk_console_bff/mq/consumer.py", line 48, in listen_send_coupon_task rev_msgs = self.consumer.consume_message(self.batch, self.wait_seconds) File "/Users/xiaomai/opt/anaconda3/envs/saas_mk_console_bff/lib/python3.7/site-packages/mq_http_sdk/mq_consumer.py", line 49, in consume_message self.mq_client.consume_message(req, resp) File "/Users/xiaomai/opt/anaconda3/envs/saas_mk_console_bff/lib/python3.7/site-packages/mq_http_sdk/mq_client.py", line 135, in consume_message resp_inter = self.http.send_request(req_inter) File "/Users/xiaomai/opt/anaconda3/envs/saas_mk_console_bff/lib/python3.7/site-packages/mq_http_sdk/mq_http.py", line 124, in send_request raise MQClientNetworkException("NetWorkException", str(e)) # raise netException mq_http_sdk.mq_exception.MQClientNetworkException: MQClientNetworkException ("NetWorkException", "Request-sent")