title: Celery dynamic queue creation and routing
body: <p>I'm trying to call a task and create a queue for that task if it doesn't exist then immediately insert to that queue the called task. I have the following code:</p>
  
  <pre><code>@task
  def greet(name):
      return "Hello %s!" % name
  
  
  def run():
      result = greet.delay(args=['marc'], queue='greet.1',
          routing_key='greet.1')
      print result.ready()
  </code></pre>
  
  <p>then I have a custom router:</p>
  
  <pre><code>class MyRouter(object):
  
      def route_for_task(self, task, args=None, kwargs=None):
          if task == 'tasks.greet':
              return {'queue': kwargs['queue'],
                      'exchange': 'greet',
                      'exchange_type': 'direct',
                      'routing_key': kwargs['routing_key']}
          return None
  </code></pre>
  
  <p>this creates an exchange called <code>greet.1</code> and a queue called <code>greet.1</code> but the queue is empty. The exchange should be just called <code>greet</code> which knows how to route a routing key like <code>greet.1</code> to the queue called <code>greet.1</code>.</p>
  
  <p>Any ideas?</p>