Apama 10.15.0 | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The HTTP Client Transport Connectivity Plug-in | Configuring the HTTP client transport
 
Configuring the HTTP client transport
The HTTP client should be added to a chain containing the appropriate mapping rules (see Mapping events between EPL and HTTP client requests for detailed information). Connection information is configured through the HTTPClientTransport element in each chain. For example:
startChains:
HTTPClientChain:
- apama.eventMap
    codecs...
- HTTPClientTransport:
host: www.google.com
basePath: "/myapi/v123"
port: 80
timeoutSecs: 120
tls: false
tlsAcceptUnrecognizedCertificates: false
tlsCertificateAuthorityFile: ""
followRedirects: true
cookieJar: true
numClients: 1
authentication:
authenticationType: none
username: ""
password: ""
proxy:
host: ""
port: ""
authentication:
authenticationType: none
username: ""
password: ""
The configuration options below can either be configured statically in the configuration file, or via replacement variables. Variables of the form ${varname} are replaced at correlator startup time either from a provided .properties file or from the correlator command line. Variables of the form @{varname} are replaced at chain creation time if using dynamic connections to services (see also Configuring dynamic connections to services).
Note: 
When you have selected the generic option when adding the HTTP Client connectivity bundle in Software AG Designer or using the apama_project tool (see Creating and managing an Apama project from the command line), variables of the form @{varname} are passed from EPL. See Using predefined generic event definitions to invoke HTTP services with JSON and string payloads for further information.
The following configuration options are available for the HTTP client:
Configuration option
Description
host
Required. The name of the host to connect to.
Type: string.
basePath
Optional path to be prefixed to the metadata.http.path for all messages sent to this transport. If you have multiple remote applications on a single host but with different base paths, you will need to create multiple transport instances with different basePath values. The metadata.http.path in responses will include the prefix, if any.
Type: string.
port
The port number to connect to.
Type: integer.
Default: 443 if the tls configuration option is true, otherwise 80.
timeoutSecs
Client TCP timeout in seconds.
Type: integer.
Default: 120.
tls
If true, TLS is used for the connection to the host.
Type: bool.
Default: false.
tlsAcceptUnrecognizedCertificates
By default, connections to unrecognized certificates are terminated. Set this to true if non-validated server certificates are to be accepted.
Type: bool.
Default: false.
tlsCertificateAuthorityFile
By default, server certifications signed by all standard Certificate Authorities are validated. Optionally, you can set this option to provide a path to a CA certificate file in PEM format to authenticate the host with.
Type: string.
followRedirects
If set to true, HTTP redirects are to be followed transparently to the new URL. This pertains to responses with status codes for permanent redirections (301 and 308) and temporary redirections (302, 303 and 307). If set to false, the responses with the above status codes are delivered to EPL and must be handled there.
In some cases, following a redirect will result in the server responding with one or more further redirects. To prevent redirect loops, the total number of automatic redirects is limited. An error status code (400) will be sent to the EPL application when the limit has been reached.
For security reasons, redirects to a different host or to a different protocol (for example, from HTTP to HTTPS) are not followed.
Type: bool.
Default: true.
cookieJar
If set to true, cookies are to be stored in memory and added to subsequent outgoing requests. If set to false, cookies are placed in the metadata and must be handled by EPL. For more information, see Dealing with cookies.
Type: bool.
Default: true.
numClients
The number of simultaneous threads and HTTP client connections to use for requests. This allows requests to be processed concurrently, to improve performance. For more details, and how to avoid races where requests cannot be processed concurrently, see Executing HTTP requests concurrently.
Type: integer.
Default: 1.
authentication/authenticationType
Set this to HTTP_BASIC if you want to authenticate using HTTP basic authentication.
Type: HTTP_BASIC or none.
Default: none.
authentication/username
Optional user name for HTTP basic authentication.
Type: string.
authentication/password
Optional password for HTTP basic authentication.
Type: string.
Important: 
If you provide the password for HTTP_BASIC authentication via the configuration file, you must ensure to protect the configuration file against any unauthorized access, since the password will be readable in plain text. To avoid this, you can provide the password via a replacement variable from EPL (see also Configuring dynamic connections to services).
proxy/host
The name of the proxy server to connect to.
Type: string.
proxy/port
The port number of the proxy server to connect to.
Required if proxy/host is configured.
Type: integer.
proxy/authentication/authenticationType
Set this to HTTP_BASIC if you want to authenticate the proxy server using HTTP basic authentication.
Type: HTTP_BASIC or none.
Default: none.
proxy/authentication/username
Optional proxy user name for HTTP basic authentication.
Type: string.
proxy/authentication/password
Optional proxy password for HTTP basic authentication.
Type: string.