'Celery-defined method allowing for custom routing logic.
If None is returned from this method, default routing logic is used.'

def route_for_task(self, task, args=None, kwargs=None):

    if (task in self.explicit_queues):
        return self.explicit_queues[task]
    alternate_env = self.alternate_env_tasks.get(task, None)
    if alternate_env:
        return self.ensure_queue_env(alternate_env)
    return None
