Apama Documentation : Connecting Apama Applications to External Components : Standard Connectivity Plug-ins : The HTTP Client Transport Connectivity Plug-in : Configuring dynamic connections to services
Configuring dynamic connections to services
Many applications have a single or small number of statically configured connections to services. For other applications, the connections can be configured dynamically at runtime. To configure the connections dynamically, define your chain under dynamicChains rather than staticChains with the configuration details using dynamic chain replacement variables (@{varname}):
dynamicChains:
http:
- apama.eventMap
mapping rules...
- httpClient:
host: "@{HOST}"
port: "@{PORT}"
Then you can create instances of that chain configured for specific hosts and ports using the createChain method on ConnectivityPlugins:
action connectToNewHost(string channelName, string host, integer port)
returns Chain
{
return ConnectivityPlugins.createChain("http-"+host+":"+port.toString(),
[channelName], "http", {"HOST":host,"PORT:"port.toString()});
}
Events can be sent to the chain via the supplied channelName. When the connection is no longer needed, it can be destroyed via the returned Chain object.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback