Reputation: 1
I've tried sending tasks with send_task
and apply_async
, it's works, but I don't want execute tasks in subprocess, I just want send it to broker. I used delay
but I can't specify the queue, any tip?
I am expecting send a task without executing
Upvotes: 0
Views: 4789
Reputation: 11
You can specify which queue tasks will be sent to with the following code:
your_celery_app.conf.task_routes = {
your_task_name: {'queue': your_queue_name}
}
your_task_name
is the task name that is printed under [tasks]
when you launch the worker, for example my_app.tasks.my_task.my_task
. your_queue_name
is the name of the queue, usually specified with the -Q
command line parameter when launching the worker.
For more information, please see https://docs.celeryq.dev/en/latest/userguide/routing.html
Upvotes: 1