Qorus Integration Engine®  4.0.3.p2_git
System Properties

This section will outline Qorus system properties, which serve as a configuration store.

System Properties Introduction

System properties are a domain-based key-value store that can be used to store persistent configuration information for Qorus interfaces. In the context of Qorus system properties, a "domain" is simply a name that groups together key-value pairs. Keys are strings, and values are any Qore value that can be serialized to YAML.

System Properties Overview

Component Description
domain a string of up to 240 bytes used to group key-value pairs; domain names are unique and case-sensitive
key a string of up to 240 bytes that uniquely identifies a value within a domain; key names are case-sensitive
value Any Qore value that can be serialized to YAML in less or equal to than 4000 bytes
Note
  • System properties are stored in the SYSTEM_PROPERTIES table in the Qorus system schema; the data size limitations listed in the table above are due to column constraints in this table.
  • YAML serialization incurs a small overhead of at least 4 bytes; trying to store a larger value will cause a PROP-ERROR exception to be thrown
  • All system property operations are protected by a read-write lock and are therefore atomic in respect to simultaneous actions in multiple threads
The "omq" domain is protected; it contains system reference information and cannot be updated.

System Properties APIs

System properties can be created, updated, read, and deleted using REST APIs, internal function calls, and from the command line.

Note
To delete a system property; call the function or network API to set the value, and omit the value; this will cause the system property key to be deleted; when the last key is deleted, the system property domain is deleted as well.

System Properties REST APIs

Action REST URI Request
read GET /api/system/props
GET /api/system/props/name
create, update, delete PUT /api/system/props/domain?action=updateMany;...
PUT /api/system/props/domain/name?action=update;...

System Properties Functions

Function Availability
prop_get() All user server code (workflows, services, jobs, and mappers) and the Qorus client library
prop_update() workflows, services, jobs

System Properties Command-Line Programs

Program Description
oprop The primary command-line interface to system properties; uses the REST API
qrest The raw REST client; can be used to query and set system properties directly with the REST API
ocmd The RPC command-line API interface; can be used to query and set system properties using the deprecated system.prop service
Note
the system.prop service is deprecated; the REST API or internal API functions should be used instead to access and manipulate system properties

System Properties Examples

REST Examples
qrest get system/props
qrest get system/props/omq
qrest get system/props/omq/value
Function Example
string ds = prop_get("mydomain", "myds") ?? "default_value";
Command-line Example
oprop get mydomain myds
oprop set mydomain hash key1=value,key2=value