The connectionPolicy element of the adapter-descriptor file lets you configure settings for your adapter's HTTP connection.
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType"; cookiePolicy="cookie-policy" maxRedirects="10">
<protocol>protocol</protocol>
<domain>host-name</domain>
<port>host-port</port>
<connectionTimeoutInMilliseconds>connection_timeout</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>socket_timeout</socketTimeoutInMilliseconds>
<authentication> … </authentication>
<proxy> … </proxy>
<sslCertificateAlias>ssl-certificate-alias</sslCertificateAlias>
<sslCertificatePassword>ssl-certificate-password</sslCertificatePassword>
<maxConcurrentConnectionsPerNode>max_concurrent_connections</maxConcurrentConnectionsPerNode>
</connectionPolicy>
The connectionPolicy element has the following attributes.
Mandatory.
The value of this attribute must be http:HTTPConnectionPolicyType.
Optional.
Optional.
The maximum number of redirects that the HTTP adapter can follow. This attribute is useful when the back-end application sends circular redirects as a result of some error, such as authentication failures. If this attribute is set to 0, the adapter does not attempt to follow redirects at all, and the HTTP 302 response is returned to the user. The default value is 10.
The connectionPolicy element has the following subelements.
Optional.
Mandatory.
The host address.
Optional.
The port address.
Optional for regular HTTP authentication and simple SSL authentication.
Mandatory for mutual SSL authentication.
The alias of the adapter private SSL key, which is used by the HTTP adapter key manager to access the correct SSL certificate in the keystore. For more information about the keystore setup process, see Using SSL in HTTP adapters.
Optional for regular HTTP authentication and simple SSL authentication.
Mandatory for mutual SSL authentication.
The password of the adapter private SSL key, which is used by the HTTP adapter key manager to access the correct SSL certificate in the keystore. For more information about the keystore setup process, see Using SSL in HTTP adapters.
Optional.
<authentication>
<basic/>
</authentication>
<authentication>
<digest/>
</authentication>
<authentication>
<basic/>
<serverIdentity>
<username></username>
<password></password>
</serverIdentity>
</authentication>
Optional.
The proxy element specifies the details of the proxy server to use when accessing the back-end application. Add a proxy element inside the connectionPolicy element. The proxy details must include the protocol domain and port. If the proxy requires authentication, add a nested authentication element inside proxy. This element has the same structure as the one used to describe the authentication protocol of the adapter. For more information, see the authentication element.
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>www.bbc.co.uk</domain>
<proxy>
<protocol>http</protocol>
<domain>wl-proxy</domain>
<port>8167</port>
<authentication>
<basic/>
<serverIdentity>
<username>${proxy.user}</username>
<password>${proxy.password}</password>
</serverIdentity>
</authentication>
</proxy>
</connectionPolicy>
Optional.
Defines the maximum number of concurrent connections, which the MobileFirst Server can open to the back end.
IBM MobileFirst™ Platform Foundation does not limit the incoming service requests from applications. This subelement can be configured at the application server level. This product limits only the number of concurrent HTTP connections to the back-end service.
The default number of concurrent HTTP connections is 50. You can modify this number based on the expected concurrent requests to the adapter and the maximum requests allowed on the back-end service. You can also configure the back-end service to limit the number of concurrent incoming requests.
Consider a two-node system, where the expected load on the system is 100 concurrent requests and the back-end service can support up to 80 concurrent requests. You can set maxConcurrentConnectionsPerNode to 40. This setting ensures that no more than 80 concurrent requests are made to the back-end service.
If you increase the value, the back-end application needs more memory. To avoid memory issues, do not to set this value too high. Instead, estimate the average and peak number of transactions per second, and evaluate their average duration. Then, calculate the number of required concurrent connections as indicated in this example, and add a 5-10% margin. Then, monitor your back end, and adjust this value as required, to ensure that your back-end application can process all incoming requests.
When you deploy adapters to a cluster, set the value of this attribute to the maximum required load divided by the number of cluster members.
For more information about how to size your back-end application, see the Scalability and Hardware Sizing document and its accompanying hardware calculator spreadsheet at Developer Center website for IBM MobileFirst Platform Foundation.
Optional.
The timeout in milliseconds until a connection to the back-end can be established. Setting this timeout does not ensure that a timeout exception occurs after a specific time elapses after the invocation of the HTTP request.
If you pass a different value for this parameter in the invokeHTTP() JavaScript function, you can override the value that is defined here. For more information, see the WL.Server class.
Optional.
The timeout in milliseconds between two consecutive packets, starting from the connection packet. Setting this timeout does not ensure that a timeout exception occurs after a specific time elapses after the invocation of the HTTP request.
If you pass a different value for the socketTimeoutInMilliseconds parameter in the invokeHttp() JavaScript function, you can override the value that is defined here. For more information, see the WL.Server class.