The xSQL configuration file can be used to define IoT (active replication) parameters corresponding to the C API structures
mco_iot_comm_params_tandmco_iot_replicator_params_t.For an overview see page Configuration File Parameters
The
iot_paramssection 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_paramssection with the corresponding C API structures and values specified in the comment:agent_id: 10024ID of this device/server; must be greater than 0 and unique across all agents (can also be specified in the schema).level: 100Possible values:"server","device", or an unsigned integer between 1 and 65535.enabled: falseDisables the IoT runtime at startup. IoT can be enabled later using thexsql_iot_enable()UDF. Default value istrue.listen_queue_size: 5Maximum length of the listen socket queue. Default is 0 (uses system-defined maximum).n_callback_threads: 16Number of threads to process incoming requests. Default value is 8.recv_timeout: 2000Timeout for therecv()operation, in milliseconds. Default is 10000 (10 seconds).send_timeout: 2000Timeout for thesend()operation, in milliseconds. Default is 10000 (10 seconds).wakeup_port: 9900Port number for the service port. Default is 0 (uses a system-defined port).conn_pool_size: 16Maximum number of cached database connections. Default is (n_callback_threads+ 2).sync_type: "pull"Type of automatic synchronization (used withsync_on_connectandsync_period). One of:
"push"— send outgoing data,"pull"— request incoming data,"sync"— both (default).clear_on_ack: falseWhether to remove outgoing data after it has been acknowledged by the recipient. Default isfalse.sync_on_connect: trueWhether to perform synchronization immediately after a connection is established (sync_typedefines direction). Default isfalse.sync_period: 120000Interval (in milliseconds) for automatic synchronization (sync_typedefines direction). Default is 0 (disabled).compression_levelGlobal compression level for all clients (unless overridden in theconnectionssection): 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,