Creates a Sender options object by parsing the provided configuration string.
Configuration string.
Optional
extraOptions: ExtraOptionsOptional extra configuration.
Optional
protocol_Optional
addrOptional
hostOptional
portOptional
usernameOptional
passwordOptional
tokenOptional
token_Optional
token_Optional
auto_Optional
auto_Optional
auto_Optional
request_Optional
request_Optional
retry_Optional
init_Optional
max_Optional
tls_Optional
tls_Optional
tls_Optional
tls_Optional
max_Optional
logOptional
agentOptional
stdlib_Optional
authOptional
jwkStatic
resolveResolves the protocol version, if it is set to 'auto'.
If TCP transport is used, the protocol version will default to 1.
In case of HTTP transport the /settings endpoint of the database is used to find the protocol versions
supported by the server, and the highest will be selected.
When calling the /settings endpoint the timeout and TLs options are used from the options object.
SenderOptions instance needs resolving protocol version
Static
resolveStatic
fromCreates a Sender options object by parsing the provided configuration string.
Configuration string.
Optional
extraOptions: ExtraOptionsOptional extra configuration.
A Sender configuration object initialized from the provided configuration string.
Static
fromCreates a Sender options object by parsing the configuration string set in the QDB_CLIENT_CONF environment variable.
Optional
extraOptions: ExtraOptionsOptional extra configuration.
A Sender configuration object initialized from the QDB_CLIENT_CONF environment variable.
Sender configuration options.
Properties of the object are initialized through a configuration string.
The configuration string has the following format: <protocol>::<key>=<value><key>=<value>...;
The keys are case-sensitive, the trailing semicolon is optional.
The values are validated and an error is thrown if the format is invalid.
Connection and protocol options
When https or tcps used, the connection is secured with TLS encryption.
Version 1 uses text-based serialization for all data types. Version 2 uses binary encoding for doubles and arrays.
When set to 'auto' (default for HTTP/HTTPS), the client automatically negotiates the highest supported version with the server.
TCP/TCPS connections default to version 1.
If no port is specified, a default will be used.
When the protocol is HTTP/HTTPS, the port defaults to 9000. When the protocol is TCP/TCPS, the port defaults to 9009.
Examples: http::addr=localhost:9000, https::addr=localhost:9000, http::addr=localhost, tcp::addr=localhost:9009
Authentication options
For HTTP, Basic Authentication requires the password option.
For TCP with JWK token authentication, token option is required.
For TCP with JWK token authentication, this is the private key part of the JWK token, and must be accompanied by the username option.
TLS options
By default, the Sender will verify the server's certificate, but this check can be disabled by setting this option to unsafe_off.
This is useful in non-production environments where self-signed certificates might be used, but should be avoided in production if possible.
Can be useful when self-signed certificates are used, otherwise should not be set.
Auto flush options
When disabled, the flush() method of the Sender has to be called explicitly to make sure data is sent to the server.
Manual buffer flushing can be useful, especially when we want to control transaction boundaries.
When the HTTP protocol is used, each flush results in a single HTTP request, which becomes a single transaction on the server side.
The transaction either succeeds, and all rows sent in the request are inserted; or it fails, and none of the rows make it into the database.
The Sender will default this parameter to 75000 rows when HTTP protocol is used, and to 600 in case of TCP protocol.
Note that the setting is checked only when a new row is added to the buffer. There is no timer registered to flush the buffer automatically.
Buffer sizing options
If the buffer would need to be extended beyond the maximum size, an error is thrown.
HTTP request specific options
This is in addition to the calculation derived from the request_min_throughput parameter.
If the throughput is lower than this value, the connection will time out. This is used to calculate an additional timeout on top of request_timeout. This is useful for large requests. You can set this value to 0 to disable this logic.
The interval between retries is an exponential backoff starting at 10ms and doubling after each failed attempt up to a maximum of 1 second.
Other options
Recommended to use the same setting as the server, which also uses 127 by default.