Apama 10.3 | 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}):
- 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 createDynamicChain method on ConnectivityPlugins:
action connectToNewHost(string channelName, string host, integer port,
string defaultChannelTowardsHost)
returns Chain
return ConnectivityPlugins.createDynamicChain(
"http-"+host+":"+port.toString(), [channelName],
"http", {"HOST":host,"PORT:"port.toString()}, defaultChannelTowardsHost);
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-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.