I have settings in my celery config
CELERY_QUEUES = (
Queue('oracle', Exchange('exchange1'), routing_key='bitch'),
Queue('neo', Exchange('exchange2'), routing_key='check'),
Queue('morpheus', Exchange('exchange3'), routing_key='fromlocal'),
Queue('trinity', routing_key='getme.*'),
Queue('xxx', routing_key='showme.#'),
),
CELERY_ROUTES={
'whois.tasks.parsewhois':{
'queue':'trinity',
'routing_key':'getme.*',
},
'whois.tasks.fororacle':{
'queue':'xxx',
'routing_key':'showme.#',
},
},
And i run my 2 workers as
celery -A jarvis worker -l info -Q trinity --hostname=trinity@%h
celery -A jarvis worker -l info -Q xxx --hostname=xxx@%h
Now as i send a task to my worker
parsewhois.apply_async(args['20596696'],queue='trinity',routing_key='getme')
The above task goes only to the trinity queue, but as i run the command below:
fororacle.apply_async(args=[10],queue='xxx',routing_key='showme')
now this task goes to both trinity queue and xxx queue, both get the same tasks and operates same task. Is it that i'm not getting difference of topic and direct or is my configuration just wrong. Can anyone help me?
try execute celery commands with different worker names:
celery -A jarvis worker -l info -Q trinity --hostname=trinity@%h -n worker1.%h
celery -A jarvis worker -l info -Q xxx --hostname=xxx@%h -n worker2.%h
Hope that will help