Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
VictorGaiva opened this issue Mar 30, 2024 · 2 comments
Open

Comments

@VictorGaiva
Copy link
Owner

VictorGaiva commented Mar 30, 2024

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
Copy link
Owner Author

Reopening this issue as it is still present.

@VictorGaiva
Copy link
Owner Author

VictorGaiva commented Jun 26, 2024

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

@VictorGaiva VictorGaiva changed the title Attempting to Subscribe before the connection is fully authenticated caused crash Subscripting to replicas other than the main might cause it to fail. Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant