Some sample queries with ksqlDB
- Ktable to get the latest value based on another field timestamp
- Get stream with enriched data from another stream
- Merge three streams based in a common field
docker-compose up -d
docker exec -it ksqldb-cli ksql http://ksqldb-server:8088
Load file (ktable-store-latest-value-by-time.sql)
curl -X "POST" "http://localhost:8088/query" \
-H "Accept: application/vnd.ksql.v1+json" \
-d $'{
"ksql": "SELECT * FROM values_table where key=1;",
"streamsProperties": {}
}' | jq
curl -X "POST" "http://localhost:8088/query" \
-H "Accept: application/vnd.ksql.v1+json" \
-d $'{
"ksql": "SELECT * FROM values_table EMIT CHANGES;",
"streamsProperties": {}
}'