title: How to route tasks to different queues with Celery and Django
body: <p>I am using the following stack:</p>
  
  <ul>
  <li><strong>Python 3.6</strong></li>
  <li><strong>Celery v4.2.1</strong> (Broker: <strong>RabbitMQ v3.6.0</strong>)</li>
  <li><strong>Django v2.0.4</strong>.</li>
  </ul>
  
  <p>According <a href="http://docs.celeryproject.org/en/latest/userguide/routing.html" rel="noreferrer">Celery's documentation</a>, running scheduled tasks on different queues should be as easy as defining the corresponding queues for the tasks on <strong>CELERY_ROUTES</strong>, nonetheless all tasks seem to be executed on Celery's default queue. </p>
  
  <p>This is the configuration on <strong>my_app/settings.py</strong>:</p>
  
  <pre><code>CELERY_BROKER_URL = "amqp://guest:guest@localhost:5672//"
  CELERY_ROUTES = {
   'app1.tasks.*': {'queue': 'queue1'},
   'app2.tasks.*': {'queue': 'queue2'},
  }
  CELERY_BEAT_SCHEDULE = {
      'app1_test': {
          'task': 'app1.tasks.app1_test',
          'schedule': 15,
      },
      'app2_test': {
          'task': 'app2.tasks.app2_test',
          'schedule': 15,
      },
  
  }
  </code></pre>
  
  <p>The tasks are just simple scripts for testing routing:</p>
  
  <p>File <strong>app1/tasks.py</strong>:</p>
  
  <pre><code>from my_app.celery import app
  import time
  
  
  @app.task()
  def app1_test():
      print('I am app1_test task!')
      time.sleep(10)
  </code></pre>
  
  <p>File <strong>app2/tasks.py</strong>:</p>
  
  <pre><code>from my_app.celery import app
  import time
  
  
  @app.task()
  def app2_test():
      print('I am app2_test task!')
      time.sleep(10)
  </code></pre>
  
  <p>When I run Celery with all the required queues:</p>
  
  <pre><code>celery -A my_app worker -B -l info -Q celery,queue1,queue2
  </code></pre>
  
  <p>RabbitMQ will show that only the default queue "<strong>celery</strong>" is running the tasks:</p>
  
  <pre><code>sudo rabbitmqctl list_queues
  # Tasks executed by each queue:
  #  - celery 2
  #  - queue1 0
  #  - queue2 0
  </code></pre>
  
  <p>Does somebody know how to fix this unexpected behavior?</p>
  
  <p>Regards,</p>