-
Notifications
You must be signed in to change notification settings - Fork 0
/
kafka_ksql.http
42 lines (33 loc) · 962 Bytes
/
kafka_ksql.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Check server status
GET http://localhost:8088/info
###
# Create source stream
POST http://localhost:8088/ksql HTTP/1.1
Accept: application/vnd.ksql.v1+json
Content-Type: application/json
{
"ksql": "CREATE STREAM json_sensor1_source (\"timestamp\" BIGINT, \"values\" ARRAY<INTEGER>) WITH (KAFKA_TOPIC='json.sensor1', VALUE_FORMAT='JSON');",
"streamsProperties": {
"ksql.streams.auto.offset.reset": "earliest"
}
}
###
# Create sink stream
POST http://localhost:8088/ksql HTTP/1.1
Accept: application/vnd.ksql.v1+json
Content-Type: application/json
{
"ksql": "CREATE STREAM avro_sensor1 WITH (VALUE_FORMAT='AVRO') AS SELECT * FROM json_sensor1_source;",
"streamsProperties": {
"ksql.streams.auto.offset.reset": "earliest"
}
}
###
# List streams
POST http://localhost:8088/ksql HTTP/1.1
Accept: application/vnd.ksql.v1+json
Content-Type: application/json
{
"ksql": "LIST STREAMS;",
"streamsProperties": {}
}