rabbitmq-stream icon indicating copy to clipboard operation
rabbitmq-stream copied to clipboard

Subscripting to replicas other than the main might cause it to fail.

Open VictorGaiva opened this issue 10 months ago • 2 comments

Problem

In some scenarios, a Consumer fails to startup because it receives a {:error, :stream_not_available} when calling RabbitMQStream.Connection.subscribe/5.

Initially it seemed that this happened when although the tcp/ssl connection would already be open, the authentication process was not yet complete. But later It I found out that it actually happened when attempting to connect to a replica other than the Main for that stream.

Solution

Implement an abstraction on top of RabbitMQStream.Connection that auto-discovers all the nodes and routes each requests based on the defined metadata

Testing

Add replication to the services setup and create related tests.

VictorGaiva avatar Mar 30 '24 17:03 VictorGaiva

Reopening this issue as it is still present.

VictorGaiva avatar Apr 07 '24 18:04 VictorGaiva

Updated the description describing the mapped issue after the root cause was found.

VictorGaiva avatar Jun 26 '24 16:06 VictorGaiva