This commit is contained in:
2026-01-15 21:20:57 +08:00
parent 0ed3c8f94d
commit 0976909cc8
14 changed files with 414 additions and 660 deletions

View File

@@ -66,7 +66,8 @@ class KafkaService:
def produce(self, job_data: JobData) -> bool:
"""发送消息到Kafka"""
try:
future = self.producer.send(self.topic, key=job_data.id, value=job_data.model_dump())
data = job_data.to_dict()
future = self.producer.send(self.topic, key=data.get("_id"), value=data)
future.get(timeout=10)
return True
except KafkaError as e: