Apama 10.3.1 | Apama Documentation | 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 httpClient element in each chain. For example:
startChains:
http:
- apama.eventMap
    codecs...
- httpClient:
host: www.google.com
port: 80
basePath: ""
timeoutSecs: 120
tls: false
tlsAcceptUnrecognizedCertificates: false
tlsCertificateAuthorityFile: ""
followRedirects: false
cookieJar: false
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 services with a JSON payload 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.
port
The port number to connect to.
Type: integer.
Default: 443 if the tls configuration option is true, otherwise 80.
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.
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
By default, a response event with the status code is forwarded to EPL, which then has to handle the redirect. Set this to true if 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).
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: false.
Note: For backwards compatibility, followRedirects is set to false by default when it is not explicitly specified in the YAML configuration file. However, for your convenience, when you add a new HTTP Client connectivity bundle in Software AG Designer or by using the apama_project tool, this option is already set to true in the resulting YAML configuration file.
cookieJar
By default, cookies received from the server need to be handled by EPL. Set this to true if cookies are to be stored in memory and added to subsequent outgoing requests. For more information, see Dealing with cookies.
Type: bool.
Default: false.
Note: For backwards compatibility, cookieJar is set to false by default when it is not explicitly specified in the YAML configuration file. However, for your convenience, when you add a new HTTP Client connectivity bundle in Software AG Designer or by using the apama_project tool, this option is already set to true in the resulting YAML configuration file.
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).

Copyright © 2013-2019 | 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.