I am implementing a software load balancer for a cluster of servers and each server is implemented with Spring integration using TCP gateway. The cluster nodes may be up and down at runtime and I have a mechanism to detect the active nodes at the runtime.
But my problem is that the load balancer needs to connect to different servers, i.e., different hosts and port numbers. The TCP connection factory in Spring integration requires to specify the host and port when it is created. But for my case, the tcp hosts and port numbers are dynamic at runtime. If I don't want to write my TCP connection factory for different hosts and port numbers from scratch, does Spring integration provide a conveinent way to do that? Any special attention I need to pay for NIO TCP connections?
Thanks in advance,