xSQL IoT Parameters

The xSQL configuration file can be used to define IoT (active replication) parameters corresponding to the C API structures mco_iot_comm_params_t and mco_iot_replicator_params_t.

For an overview see page Configuration File Parameters

The iot_params section consists of a set of "name : value" pairs enclosed within braces. For example:

    iot_params : {
        agent_id: 10024,
        listen_queue_size: 5,
        ...
    }

The following table lists the possible options for the iot_params section with the corresponding C API structures and values specified in the comment:

agent_id: 10024
ID of this device/server; must be greater than 0 and unique across all agents (can also be specified in the schema).
level: 100
Possible values: "server", "device", or an unsigned integer between 1 and 65535.
enabled: false
Disables the IoT runtime at startup. IoT can be enabled later using the xsql_iot_enable() UDF. Default value is true.
listen_queue_size: 5
Maximum length of the listen socket queue. Default is 0 (uses system-defined maximum).
n_callback_threads: 16
Number of threads to process incoming requests. Default value is 8.
recv_timeout: 2000
Timeout for the recv() operation, in milliseconds. Default is 10000 (10 seconds).
send_timeout: 2000
Timeout for the send() operation, in milliseconds. Default is 10000 (10 seconds).
wakeup_port: 9900
Port number for the service port. Default is 0 (uses a system-defined port).
conn_pool_size: 16
Maximum number of cached database connections. Default is (n_callback_threads + 2).
sync_type: "pull"
Type of automatic synchronization (used with sync_on_connect and sync_period). One of:
  • "push" — send outgoing data,
  • "pull" — request incoming data,
  • "sync" — both (default).
clear_on_ack: false
Whether to remove outgoing data after it has been acknowledged by the recipient. Default is false.
sync_on_connect: true
Whether to perform synchronization immediately after a connection is established (sync_type defines direction). Default is false.
sync_period: 120000
Interval (in milliseconds) for automatic synchronization (sync_type defines direction). Default is 0 (disabled).
compression_level
Global compression level for all clients (unless overridden in the connections section): 0 = no compression, 1 = best speed, 9 = best compression. Default is 0.
connections: [ {...} ]
Array of connector configurations:
    # Type of connection: 'listen' (default) or 'connect'
    type: "listen",

    # IoT runtime enabled at startup (default: true)
    enabled: false,

    # Network address to connect or listen on
    address: "127.0.0.1:5000",

    # Timeout for connect() in milliseconds (for 'connect' type only)
    # Default: 2000 (2 seconds)
    connect_timeout: 2000,

    # Interval between connect() attempts in milliseconds (for 'connect' type only)
    # Default: 60000 (1 minute)
    connect_interval: 10000,

    # Use local (UNIX) socket domain. Default: false
    local_sockets: false,

    # SSL parameters. If omitted, SSL is not used.
    # To inherit global ssl_params, leave this section empty.
    ssl_params: { ... },

    # Override global compression level for this connection
    compression_level: 0,