I have a RabbitMQ server running and I'm trying to execute a task in it. I use celery for this and want to direct to a specific queue with specific exchange.
celery code
broker_uri='amqp://xxxx:xxxx@xxxx:5672;amqp://xxxx:xxxx@xxxx:5672;amqp://xxxx:xxxx@xxxx:5672/'
backend_uri="mongodb+srv://xxxxxx.mongodb.net/celery_test?retryWrites=true&w=majority"
app = Celery('TestApp', broker=broker_uri,backend=backend_uri)
@app.task
def reverse(text):
sleep(10)
return text[:-1]
when I run this, it automatically access a queue and an exchange which I haven't defined. How do I change this?
execution result
- *** --- * --- .> concurrency: 3 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery