This example demonstrates how to integrate any arbitrary load balancing logic with a
TcpClient. Load
balancing algorithms are not provided by
RxNetty, what is provided is a low level construct of
ConnectionProvider that abstracts providing connections for a
TcpClient. Higher level constructs like
Load Balancing, connection pooling, etc. can be built using these building blocks.
The code here uses a naive
TcpLoadBalancer that removes a host on any connection failure and otherwise round
robins on the set of available hosts.
This example, starts a couple emebedded TCP server and uses a list of these server addresses and an unavailable
server address to demonstrate failure detetction (not using the unavailable server) and round-robin load balancing
(alternating between the two available hosts for the requests)