I would like to be able to implement a TCP connection pool/factory that will be able to accept a dynamic host during runtime.
For example I have an outbound channel adapter that is referenced to a client connection factory. The host will need to change depending on the message in the outbound channel adapter.
I know that the host is static in this configuration. My question is, how to customize or extend the class for tcp-connection-factory to be able to connect to changing hosts. Or if there's other better way to fulfill the expected outcome, what would be that solution?
<int-ip:tcp-outbound-channel-adapter
id="outAdapter"
channel="outChannel"
connection-factory="client" />
<int-ip:tcp-connection-factory id="client"
type="client"
host="${dynamicHost}"
port="1234"
single-use="false"
so-timeout="10000" />