We have some requirements around connecting to a proprietary backed via sockets. I would assume naturally that the TCP outbound gateway is the suited for that. The other requirement that had come forward is that the socket has to be long lived as creating a new connection is very costly and the server only handles one request at a time. Would be great if you could give some insight around the following:
1. How do we configure the socket to be long lived or never expire?
2. The problem with the above is that the socket might go stale due to some unforeseen reason like firewall etc and if is does, is there an even driven way of establishing a connection again automatically?
3. The back end could expose anywhere between 2 to 60 ports each which could handle one connection. Is there an elegant way of load balancing among them without having to create 2-60 outbound gateways?
4. The load balancing can be round robin based on if the connection is available. The catch here is that the physical and logical connection might be valid but the back end is not responsive and hence may timeout. The ideal strategy would be to be aware of the connection status by trying a handshake message and if does not respond, needs to be blacklisted. The load balancer while handling the message should be aware of the false connection and avoid it altogether.This whole process needs to be asynchronous because if the load balancer is responsible for checking the connection, it needs to wait for a timeout and then fails over and by then the validity of the message might have been exceeded.
5. How can I create my own load balancing strategy to go selective round robin based on the white listed connection?
Hope the info I have given is good enough. Thanks a ton!