progress on kafka

This commit is contained in:
lennyaiko
2025-04-10 14:57:35 +01:00
parent a2e4daa4e7
commit a5d1f45c4e
3 changed files with 2 additions and 17 deletions
-2
View File
@@ -1,6 +1,4 @@
from app import create_app
from app.integrations import KafkaIntegration
from app.config import settings
app = create_app()
+1
View File
@@ -11,6 +11,7 @@ class Config:
KAFKA_BROKER = "dev-events.simbrellang.net:9084"
KAFKA_PAYMENT_TOPIC = "PROCESS_PAYMENT"
KAFKA_TIMEOUT = 5.0
settings = Config()
+1 -15
View File
@@ -12,7 +12,7 @@ if __name__ != "__main__":
while True:
message = kafka.receive_disbursement_messages(
topic=settings.KAFKA_PAYMENT_TOPIC, timeout=1.0
topic=settings.KAFKA_PAYMENT_TOPIC, timeout=settings.KAFKA_TIMEOUT
)
if message:
@@ -20,19 +20,5 @@ if __name__ != "__main__":
else:
logger.info("No message received within timeout")
# try:
# message = kafka.receive_disbursement_messages(
# topic=settings.KAFKA_PAYMENT_TOPIC, timeout=5.0
# )
# if message:
# logger.info(f"Processed message: {message}")
# else:
# logger.info("No message received within timeout")
# except Exception as e:
# print(f"Error: {e}")
# finally:
# kafka.close_consumer()
# Expose WSGI app instance for Gunicorn
wsgi_app = app