Compare commits

..

No commits in common. "43131137b8f09e731681ac24107b401e31d69293" and "cff6c7d201a0c5da347e8d11181db13170383084" have entirely different histories.

View File

@ -124,7 +124,7 @@ async def baidu_sms_kafka_consumer(ns={}):
# 订阅的主题名称
consumer.subscribe(['kaiyuanyun_msg_topic'])
while True:
msg = consumer.poll(1) # 单次轮询获取消息
msg = consumer.poll(2) # 单次轮询获取消息
if msg is None:
continue
@ -132,7 +132,7 @@ async def baidu_sms_kafka_consumer(ns={}):
pass
else:
try:
with open('/d/zhc/baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
with open('baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
f.write(f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}-{msg.value().decode('utf-8')}\n")
# print('Received message: {}'.format(msg.value().decode('utf-8')))