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

Working with a load balancer #135

Merged
merged 9 commits into from
Jan 8, 2024
Merged

Working with a load balancer #135

merged 9 commits into from
Jan 8, 2024

Conversation

tarzacodes
Copy link
Contributor

@tarzacodes tarzacodes commented Jan 4, 2024

See https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/ - part "Client Workaround With a Load Balancer"
Basically, if we are dealing with a load balancer we cannot simply get the node and use the advertised_host and advertised_port: they might be unreachable for anyone BUT the load balancer. We need to connect to the load balancer and connect to a node through it. Then check if the node we got from the LB is what we wanted (a leader for a Producer, a replica for a Consumer, anything goes for a Locator) and if it is not, close the connection and retry.
ADDENDUM: All the clients I've looked thru (Java, Go, dotnet) do the matching with the advertised_host / advertised_port and I've unable to find a way to extract the actual hosts and port, therefore at least for now we shall match with those.
THEREFORE THIS NO LONGER APPLIES:
We'll use the host to match - if a LB is used whoever set up the Rabbit cluster should not have configured advertised_host and advertised_port and the match should be done on the host name and port.

@tarzacodes tarzacodes linked an issue Jan 4, 2024 that may be closed by this pull request
@tarzacodes tarzacodes self-assigned this Jan 4, 2024
@tarzacodes tarzacodes changed the title WIP - Working with a load balancer Working with a load balancer Jan 5, 2024
icappello
icappello previously approved these changes Jan 5, 2024
tarzacodes and others added 8 commits January 8, 2024 11:34
* feat: added client side filtering of messages if offset is of type numeric, and a bunch of tests for offsets

* chore: removed useless timeout from test

---------

Co-authored-by: Luca <lmenghini@coders51.com>
Copy link
Member

@icappello icappello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@albertobarrila albertobarrila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@albertobarrila albertobarrila merged commit 7689c83 into main Jan 8, 2024
1 check passed
@albertobarrila albertobarrila deleted the 103-load-balance branch January 8, 2024 11:24
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

Successfully merging this pull request may close these issues.

load balance
4 participants