Creates a Sender options object by parsing the provided configuration string.
Configuration string.
OptionalextraOptions: ExtraOptionsOptional extra configuration.
OptionaladdrOptionalagentOptionalauthOptionalauto_Optionalauto_Optionalauto_Optionalauto_OptionalhostOptionalinit_OptionaljwkOptionallogOptionalmax_Optionalmax_Optionalmax_Optionalmulticast_OptionalpasswordOptionalportOptionalprotocol_OptionalqwpOptionalrequest_Optionalrequest_Optionalretry_Optionalstdlib_Optionaltls_Optionaltls_Optionaltls_Optionaltls_OptionaltokenOptionaltoken_Optionaltoken_OptionalusernameStaticfromCreates a Sender options object by parsing the provided configuration string.
Configuration string.
OptionalextraOptions: ExtraOptionsOptional extra configuration.
A Sender configuration object initialized from the provided configuration string.
StaticfromCreates a Sender options object by parsing the configuration string set in the QDB_CLIENT_CONF environment variable.
OptionalextraOptions: ExtraOptionsOptional extra configuration.
A Sender configuration object initialized from the QDB_CLIENT_CONF environment variable.
StaticresolveResolves 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
Staticresolve
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
WS/WSS select acknowledged QWP ingress; their connect strings use the QWP configuration schema, shared with the other QuestDB clients, and are documented in QWP.md rather than in this list. UDP selects Node-only fire-and-forget QWP datagrams and uses the options below. When https, tcps, or wss is 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. When the protocol is UDP, the port defaults to 9007.
WS/WSS resolve their address through the QWP configuration schema instead, documented in QWP.md.
Examples: http::addr=localhost:9000, https::addr=localhost:9000, http::addr=localhost, tcp::addr=localhost:9009, udp::addr=localhost:9007
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.
Reaching the threshold flushes after the completed row. This option is supported by udp only; on ws/wss it belongs to the QWP configuration schema.
Defaults to max_datagram_size, so datagrams are flushed before they outgrow the configured limit. Set it to off to disable the byte trigger.
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.
UDP specific options
A row that cannot fit a single datagram is rejected before transmission. It is also the default for auto_flush_bytes. Supported by the udp transport only. A connection string rejects it on every other transport, and ws/wss reject it however the sender was built.
65507 is the IPv4 maximum, but many hosts refuse well below it, so keep this at or under the path MTU unless the receiver is known to accept more. A datagram the operating system refuses is discarded before transmission and does not advance the published or acknowledged sequence.
Supported by the udp transport only. A connection string rejects it on every other transport, and ws/wss reject it however the sender was built.