The configuration mechanism in RSB is based on the following principles:
See also
Option names consist of multiple components which are specified in configuration-source-dependent syntax. For example, in configuration files section names like [transport.spread] are concatenated with names of contained options like port to obtain transport.spread.port. For environment variables, the name RSB_TRANSPORT_SPREAD_PORT is mapped to transport.spread.port.
Currently the following option tree is defined (uppercase option name components are placeholders, LANGUAGE refers to the implementation language, e.g. cpp, java, etc.)
Name Type Comment ---- ---- ------- + qualityofservice +-- reliability { UNRELIABLE, RELIABLE } +-- ordering { UNORDERED, ORDERED } + errorhandling +-- onhandlererror { LOG, PRINT, EXIT } + introspection +-- enabled bool +-- displayname string + plugins +-- LANGUAGE +---- path list of strings +---- load list of strings + transport +-- NAME # +---- enabled bool # +---- TRANSPORT_SPECIFIC_OPTION ? # Subtree is valid +---- converter # for all transports +------ LANGUAGE # +-------- WIRE-SCHEMA string #
Configuration sources are processed in the following order such that options from sources which are processed later take precedence over options from sources which are processed earlier:
Note
On Windows the configuration file is located at %userprofile%\.config\rsb.conf.
The following sections briefly explain the currently defined configuration sources.
Configuration files use the following syntax, which is similar to INI-files or desktop-files
Here is an example:
[qualityofservice]
reliability = UNRELIABLE
ordering = UNORDERED
[errorhandling]
onhandlererror = LOG
[transport.spread]
host = localhost
port = 4803
enabled = 1 # this is the default
[spread.converter.cpp]
image = IplImage # wire-schema = data-type
[transport.inprocess]
foo = barbar
factor = 1.5
enabled = 1
[plugins.cpp]
path = /vol/vampire/lib:/vol/cor/lib
load = rsbspread:rsbvampire # no filetype suffix
Please note that only files with the platform’s respective line endings are supported (i.e. \n on Linux and \r\n on Windows).
Environment variables are processed according to the following rules:
Examples:
Please have a look at the API documentation for ParticipantConfig (C++, Python) or Properties (Java). Links to the API documentation can be found in the left sidebar.
Consider the following situation:
Contents of ~/.config/rsb.conf
[transport.spread]
host = azurit
port = 5301
Contents of $(pwd)/rsb.conf
[transport.spread]
host = localhost
Environment Variables
RSB_TRANSPORT_SPREAD_PORT = 4444
This should result in the following effective option values:
Language | File(s) |
---|---|
C++ | “0.12” branch of https://code.cor-lab.org/git/rsb.git.cpp at src/rsb/ |
Java | “0.12” branch of https://code.cor-lab.org/git/rsb.git.java at src/rsb/ |
Python | /../rsb-python/rsb/__init__.py |
Common Lisp | /../rsb-cl/src/configuration.lisp |