Apama 10.15.0 | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The HTTP Server Transport Connectivity Plug-in | Configuring the HTTP server transport
 
Configuring the HTTP server transport
The HTTP server has a manager that deals with connections and a chain that deals with mapping events into the correlator. There must be exactly one chain definition which will be used by all managers. If you require multiple ports (that is, with different options), then you need multiple managers. The HTTP server should be added to a manager and chain containing the appropriate mapping rules (see Mapping events between EPL and HTTP server requests for detailed information).
Manager
Example:
dynamicChainManagers:
HTTPServerManager:
transport: HTTPServerTransport
managerConfig:
port: 15910
bindAddress: 10.13.23.125
tls: false
tlsKeyFile: ${PARENT_DIR}/servername.key.pem
tlsCertificateFile: ${PARENT_DIR}/servername.cert.pem
connectionTimeoutSecs: 60
maxConnections: 16
keepAliveTimeSecs: 120
concurrentChains: true
staticFiles:
/swagger.json:
file: ${PARENT_DIR}/swaggerDefault.json
contentType: application/json
charset: utf-8
The following configuration options are available for the manager on the HTTP server:
Configuration option
Description
port
Required. The user-defined port on which the server is accessible.
Type: integer.
bindAddress
Optional. Binds to specific interfaces, potentially on multiple ports. Each entry is either a host, or a host:port combination. If a port is provided, it is used. Otherwise, the port option applies. The default is to bind to all interfaces on the configured port.
Type: string or list<string>.
Default: blank.
tls
Optional. Set this to true to enable TLS (https).
Type: bool.
Default: false.
tlsKeyFile
The private key for the certificate in PEM format. Required if TLS is enabled.
Type: path.
tlsCertificateFile
The server certificate file in PEM format. Required if TLS is enabled.
Type: path.
connectionTimeoutSecs
Maximum time to handle a single request before returning a timeout (in seconds).
Type: integer.
Default: 60.
maxConnections
Maximum number of simultaneous connections which can be handled.
Type: integer.
Default: 16.
keepAliveTimeSecs
Optional. Set this to the maximum idle time in seconds between requests on a persistent connection before it is closed. If not set, the default value is used.
Type: integer.
Default: 15.
concurrentChains
Optional. Set this to true to enable concurrent chains where each connection uses a different chain into the HTTP server to process requests and responses, up to a maximum of maxConnections. Requests on the same connection are processed in order.
If set to false (default), concurrent chains are disabled. A single chain is used for all connections, and it only processes a single request at a time.
Type: bool.
Default: false.
staticFiles
Optional. Map of static files. Elements are of the form:
/url:
file: ${PARENT_DIR}/source_file.txt
contentType: text/plain
charset: utf-8
file and contentType are required, charset is optional.
Type: Map.
Default: undefined.
Chain
Example:
dynamicChains:
HTTPServerChain:
- apama.eventMap
        mapping rules...
- HTTPServerTransport:
authentication:
authenticationType: none
allowedUsersFile: ${PARENT_DIR}/userfile.txt
maxAttempts: 5
coolDownSecs: 30
automaticResponses: false
responseCompression: "ifRequested"
responseTimeoutMs: 5000
allowedMethods: [PUT]
The following configuration options are available for the chain on the HTTP server:
Configuration option
Description
authentication/authenticationType
Set this to HTTP_BASIC if you require HTTP basic authentication.
Type: HTTP_BASIC or none.
Default: none.
authentication/allowedUsersFile
Path to the password file (see Authentication). Required if the authentication type is HTTP_BASIC.
Type: path.
authentication/maxAttempts
Maximum number of failed login attempts before throttling the requests for that user. See Authentication for more information.
Type: integer.
Default: 3.
authentication/coolDownSecs
The number of seconds after the maximum number of failed login attempts before the HTTP server attempts authentication of the user again. See Authentication for more information.
Type: integer.
Default: 20.
automaticResponses
Set this to true if you want a submission-only API where the responses are generated automatically by the transport. If set to false, the transport will wait for a response from the EPL application, subject to a timeout.
Type: bool.
responseCompression
The Accept-Encoding header is used for negotiating content encoding. Set this to ifRequested if you want to encode an EPL response or a static file. If set to never, no encoding is applied to the entity-body.
Type: string.
Default: never.
responseTimeoutMs
The number of milliseconds we wait for a response from the EPL application before returning to the client.
Type: integer.
Default: 5000 (5s).
allowedMethods
Required. List of permitted HTTP verbs (for example, PUT or GET).
Type: string or list<string>.
maxRequestBytes
Maximum permitted HTTP payload size in bytes.
Type: integer.
Default: 1048576 (1MB).