Skip to content

Only one process of multiple processes receives it, use FANOUT #1327

Answered by Lancetnik
v2boardbot asked this question in Q&A
Discussion options

You must be logged in to vote

FANOUT exchange deliveres message to all binded queues. So, to consume message double you should bind another queue to this exchange with another routing key/name.

The following setup should works fine

@broker.subscriber(queue_1, exch)
async def base_handler1(logger: Logger):
    ...
    
@broker.subscriber(queue_2, exch)  # another queue
async def base_handler1(logger: Logger):
    ...

RMQ message pipeline works the following way: EXCHANGE -> QUQEUE -> SUBSCRIBER
You tried to consume message multiple times from the same QUEUE, but it is impossible.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Lancetnik
Comment options

@v2boardbot
Comment options

@Lancetnik
Comment options

Answer selected by v2boardbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants