Common Configuration
Overview
All applications that run in the Service Daemon have common configuration options that can be applied to them. These options should be configured at the same level as the individual application parameters, i.e.:
<?xml version="1.0" encoding="utf-8"?>
<n2svcd>
...
<applications>
...
<application name="<name>" module="<module>>">
<include><lib>/path/to/library</lib></include>
<parameters>
<!-- application-specific parameters -->
</parameters>
</application>
...
</application>
...
</n2svcd>
Parameter Types
N2SVCD Applications support a variety of configuration parameter types, some with defined ranges of possible inputs.
Parameter Type | Description |
---|---|
String | A string containing any characters, e.g. abc . |
Hex String | A string containing hexadecimal characters, e.g. 123abc . |
Integer | A signed whole number, e.g. -1 , 0 , 1 , etc. |
Unsigned Integer | An unsigned whole number, e.g. 0 , 1 , 2 , etc. |
Enumeration | As for Unsigned Integer, but within a defined range. |
Positive Integer | An unsigned positive number, e.g. 1 , 2 , 3 , etc. |
Number | A number with any sign and optionally a fractional component, e.g. 1.0 , 2.5 , etc. |
Boolean | A binary value, represented as any of the case-insensitive possible pairs 1 /0 , Y /N , YES /NO , ON /OFF , T /F , or TRUE /FALSE . |
Array | An ordered list of other parameter values of the same type. |
Object | A container for other arbitrary parameter values. |
Configuration Details
The application
element attributes for all Application instances are as below. For details of the various parameter
types used, refer to Common Configuration.
TCP Configuration Details
Some Application instances contain TCP/IP functionality. In addition to the common Application configuration parameters, such Applications may also include the below. For details of the various parameter types used, refer to Common Configuration.
Attribute | Type | Description |
---|---|---|
parameters
|
Array |
[Required] As per Common Configuration Application
parameters .
|
.socket_mode
|
String |
This must be either listen (TCP Server) or connect (TCP Client).(Default = connect )
|
.listen_queue
|
Integer |
Backlog of pending accepts on the listen socket when socket_mode is listen .This value may need to be increased when operating under heavy load.. (Default = 10 )
|
.local_host
|
String |
Local IPv4 Host Name or A.B.C.D IPv4 Address for the TCP client connection. (Default = 0.0.0.0 , all addresses)
|
.local_port
|
Positive Integer |
Local IPv4 Port Number for the TCP client connection. Using this option will cause a port confict if
num_client_connections is > 1 .(Default = application-specific or determined by OS TCP layer, generally a system-allocated ephemeral port) |
.remote_host
|
String |
[Conditional] IPv4 Host Name or A.B.C.D IPv4 Address to connect to. Must be provided when
socket_mode = connect .
|
.remote_port
|
Positive Integer |
[Conditional] IPv4 Port Number to connect to. Must be provided when
socket_mode = connect .
|
.ssl
|
Integer |
Whether the Application should use SSL/TLS for its server connections.1 (Use SSL/https) or 0 (No-SSL, use http).(Default = 0 )
|
.SSL_verify_mode
|
Integer |
Wheter the Application should verify the Server Peer's certificate.1 (Verify Server's Certificate) or 0 (Do not verify Server's Certificate).(Default = 1 )
|
.SSL_ca_file
|
String |
Use a Certificate Authority contained in the indicated file. (Default = Use system default Certificate Authorities) |
.SSL_ca_path
|
String |
Use all Certificate Authority files contained in the indicated directory. Multiple directories may be delimited by the : character.(Default = Use system default Certificate Authorities) |
.num_client_connections
|
Positive Integer |
Number of simultaneous TCP client connections opened when socket_mode = connect .
(Default = 1 )
|
.pool
|
Positive Integer |
[Deprecated] Alias for num_client_connections .
|
.connection_backlog
|
Positive Integer |
Number of in-progress requests to allow on a connection. (Default = 10 )
|
.backlog_timeout
|
Positive Integer |
Number of seconds to wait for a free connection before abandoning the request. (Default = 10 )
|
.server_timeout
|
Positive Integer |
Number of seconds to wait on a submitted request before abandoning the request. (Default = 20 )
|
.reconnect_interval
|
Positive Integer |
Time in seconds between attempts to re-connect a failed connection. (Default = 5 )
|
.ping_interval
|
Integer |
Time in seconds between sending the Application's protocol-specific ping message to check each connection.
Note that not all applications support sending pings; this value will be ignored if so.
A ping_interval of zero will disable ping connection checks.(Default = 0 )
|
.ping_always
|
Boolean |
Whether the the Application's protocol-specific ping message should always be sent, even when the connection is
active with user messages. (Default = false , send ping only when inactive)
|
.max_send_attempts
|
Positive Integer |
Maximum number of attempts for sending each each request in the case
where the connection dies while the message is in transit.
A value of 1 means do not retry messages on failed connections.(Default = 2 )
|
.warning_queue_above
|
Positive Integer |
Generate a warning if the number of unqueued messages reaches this value. (Default = 20 )
|
.notice_queue_below
|
Positive Integer |
Generate a notice if the number of unqueued messages falls below this value. (Default = 15 )
|
.report_queue_warning_period
|
Positive Integer |
The number of seconds between reporting on the queue warning state. (Default = 30 )
|
Message Handling
All applications use the following messages:
- HEARTBEAT Messages.
- MANAGEMENT Messages (
!MANAGEMENT-*-REQUEST
inbound).