0

I am trying to insert data to QuestDb using Influx Line Protocol but cannot see anything when I query the table. My code is very simple, ILP line is taken from the QuestDb ILP examples

Poco::Net::SocketAddress socket_address{ "127.0.0.1", 9009 };
Poco::Net::StreamSocket socket{ socket_address };
unsigned char ilp_message[]{ "readings,city=London,make=Omron temperature=23.5,humidity=0.343 1465839830100400000" };
int bytes_sent = socket.sendBytes(ilp_message, sizeof(ilp_message));

But I see back in logs

 I i.q.c.l.t.LineTcpConnectionContext [18] peer disconnected with partial measurement, 83 unprocessed bytes

and 83 is the exact message size I am trying to send.

allnau
  • 323
  • 1
  • 5

4 Answers4

3

I looks like you miss new line character at the end of ILP string. New line will indicate that the line is complete.

djbobo
  • 487
  • 2
  • 6
  • 1
    To help out with ILP messages, see the following guide which has details on the message format and common pitfalls - https://questdb.io/docs/guides/influxdb-line-protocol – Brian Smith Apr 15 '21 at 12:34
0

Take note that if the column has been defined in the table as string, and the string value in your ILP contains space, each space value in the ILP will need to be escaped before you can successfully insert it into QuestDB.

louis xie
  • 1,352
  • 2
  • 12
  • 22
0

Resurrecting this as earlier this year QuestDB released official clients in seven languages (C/C++, Go, Rust, Python, JAVA, .NET, and NodeJS) so you don't need to worry about composing the ILP message yourself.

Javier Ramirez
  • 3,446
  • 24
  • 31
-1

All strings needs quotes. Therefore ...city="London".....

Urs
  • 19
  • 1
  • 1
    In the QuestDB example, city=London is a symbol and that's why it doesn't need to be enclosed in quotes. if the city column has been predefined as a string datatype, then you will need to enclose string values within quotes in the ILP – louis xie Jun 14 '21 at 16:28