37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
|
from celery import Celery
|
||
|
from kombu import Queue, Exchange
|
||
|
import environ
|
||
|
env = environ.Env(
|
||
|
DEBUG=(bool, True)
|
||
|
)
|
||
|
|
||
|
app: Celery = Celery(
|
||
|
"postman",
|
||
|
broker= env.str("CELERY_BROKER", "amqp://test:test@rabbitmq:5672"),
|
||
|
include=[
|
||
|
"celery_worker.mock_process_tasks_fi",
|
||
|
],
|
||
|
)
|
||
|
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'},
|
||
|
},
|
||
|
}
|
||
|
)
|