Another gotcha. If you try to do add.apply_async((1,2), queue=’moon’, routing_key=’whatever’), the message ends up in the ‘moon’ queue. It is kind of surprising because the RabbitMQ documentation says that when a new message with routing key R arrives at the direct exchange, the exchange routes it to the queue if K = R where K is the routing key a queue is bound to the exchange (see https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchange-direct). So I would expect that the above message won’t be delivered until a queue with the name ‘moon’ and routing key ‘whatever’ is created. Whilst you check the task metadata you’re gonna find that its routing key is ‘moon’. I have no idea why Celery ignores the explicitly set key in this case.
