Yerbol Suleimanov
Yerbol Suleimanov

Reputation: 147

Is it possible to read one rabbitmq stream message with a single service instance?

Is it possible to read stream messages one by one with a replicated consumer? If yes, how to do it? My situation is: I have one service-consumer with 3 replications. I want it to read stream messages as like from queue, when one message is processed only by a single instance(replication). I found that we can set a consumer name, but don't know how to do it in node.js-amqplib library. Also don't know will it help or not.

Upvotes: 0

Views: 648

Answers (2)

leonidos79
leonidos79

Reputation: 149

I was looking for roughly the same solution - how to achieve read-once guarantee across all consumers - and eventually realized this scenario is not fit for streams, but rather for our old friends, message queues. The messages in the streams ARE supposed to be read multiple times; that’s what “non-destructible consumer semantics” is all about. Hence the requirement to process each message exactly once goes against the very nature of Streams…

Upvotes: 0

Yerbol Suleimanov
Yerbol Suleimanov

Reputation: 147

Currently it is not possible depending on official documentation. And didn't find any addons.

Upvotes: 1

Related Questions