Skip to content

Messages are sent to wrong queues #408

Closed Answered by vk496
vk496 asked this question in Q&A
Discussion options

You must be logged in to vote

I was so focused on taskiq that I forgot that by default, it works on topics routing. Here the same code working as expected:

import asyncio

from taskiq import TaskiqEvents, TaskiqState
from taskiq_aio_pika import AioPikaBroker
from taskiq_redis import RedisAsyncResultBackend

amqp_url: str = "amqp://guest:guest@localhost:5672"
redis_url: str = "redis://localhost"

broker1 = AioPikaBroker(url=amqp_url, queue_name="q1", routing_key="ask.#").with_result_backend(
    RedisAsyncResultBackend(redis_url)
)
broker2 = AioPikaBroker(url=amqp_url, queue_name="q2", routing_key="suggest.#").with_result_backend(
    RedisAsyncResultBackend(redis_url)
)


@broker1.on_event(TaskiqEvents.WORKER_STARTUP)
a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by s3rius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant