Brian L. Clark
Brian L. Clark

Reputation: 628

How to consumer from a celery queue in a different app

I have the below code in my producer application for inserting API calls into my RabbitMQ using Celery.

celery.send_task('tasks.process_redox', (payload,), queue="redox_inbound")

I was wondering, what would the code look like to consume from that queue? I have the below but it isn't working, can't seem to find it in the

@celery.task()
def process_redox(payload):
  data = encrypter.decrypt(payload)
  print data
  return

Upvotes: 0

Views: 723

Answers (1)

lpiner
lpiner

Reputation: 465

You need to tell celery to watch that queue.

app.conf.task_queues = (
    Queue('redox_inbound',    routing_key='default'),
)

http://docs.celeryproject.org/en/latest/userguide/routing.html#manual-routing

Upvotes: 1

Related Questions