Skip to content

HTTP transport and configuration string

Latest
Compare
Choose a tag to compare
@glasstiger glasstiger released this 29 Apr 19:42
· 4 commits to main since this release
97a5f9e

Release overview

Major API improvements, including support for InfluxDB Line Protocol over HTTP.

Breaking change: With the introduction of the HTTP transport it is now mandatory to select the protocol to be used by the client.

What is new

Support for the ILP protocol over HTTP transport, as well as the new config string syntax

  • The new HTTP sender has better error reporting. In particular, it returns an error if the QuestDB server failed to write ILP messages for any reason.
  • HTTP sender handles network errors and retries writes automatically.
  • HTTP sender reuses connections to avoid open connection overhead for each flush() call.
  • The new fromConf() method provides a convenient way for constructing a Sender via a configuration string.

Migration

v2 code example:

const sender = new Sender();
await sender.connect({ port: 9009, host: 'localhost' });
sender.table('tablename').intColumn('id', 0).atNow();
await sender.flush();
await sender.close();

Migrated v3 code:

const sender = Sender.fromConfig('http::addr=localhost:9000');
await sender.table('tablename').intColumn('id', 0).atNow();
await sender.flush();
await sender.close();

Note, that the migrated code uses the HTTP sender instead of the TCP one.