Answer the question
In order to leave comments, you need to log in
Why does a task sent to the RabbitMQ queue using aio_pika not appear there?
I want to send a message to RabbitMQ. I declare connection:
db.client = await connect("amqp://user:[email protected]_rabbitmq")
async def get_rabbitmq_channel(queues_to_declare=None) -> Channel:
if queues_to_declare is None:
queues_to_declare = []
chan = await db.client.channel()
for q in queues_to_declare:
chan.declare_queue(q)
return chan
await rabbit_channel.default_exchange.publish(
Message(
body=str(
NewFaceToRabbit(image_id=str(image_id), task_id=task_id, trait_id=str(trait_id.inserted_id),
append=append_face).dict()).encode()
),
routing_key="addface" # эта очередь была определена с помощью delcare_queue в функции выше
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question