sbt-idp/cope2n-ai-fi/celery_worker/worker_fi.py

38 lines
1.2 KiB
Python
Raw Normal View History

2023-11-30 11:22:16 +00:00
from celery import Celery
from kombu import Queue, Exchange
import environ
env = environ.Env(
2023-12-14 03:54:03 +00:00
DEBUG=(bool, False)
2023-11-30 11:22:16 +00:00
)
app: Celery = Celery(
"postman",
broker= env.str("CELERY_BROKER", "amqp://test:test@rabbitmq:5672"),
include=[
"celery_worker.mock_process_tasks_fi",
],
2023-12-14 06:26:16 +00:00
broker_transport_options={'confirm_publish': False},
2023-11-30 11:22:16 +00:00
)
task_exchange = Exchange("default", type="direct")
task_create_missing_queues = False
app.conf.update(
{
"result_expires": 3600,
"task_queues": [
Queue("invoice_fi"),
Queue("invoice_sap"),
Queue("invoice_manulife"),
Queue("invoice_sbt"),
],
"task_routes": {
'process_fi_invoice': {'queue': "invoice_fi"},
'process_fi_invoice_result': {'queue': 'invoice_fi_rs'},
'process_sap_invoice': {'queue': "invoice_sap"},
'process_sap_invoice_result': {'queue': 'invoice_sap_rs'},
'process_manulife_invoice': {'queue': 'invoice_manulife'},
'process_manulife_invoice_result': {'queue': 'invoice_manulife_rs'},
'process_sbt_invoice': {'queue': 'invoice_sbt'},
'process_sbt_invoice_result': {'queue': 'invoice_sbt_rs'},
},
}
)