Skip to content

Commit b032c4d

Browse files
authored
Support pgsql-kafka binding (#1245)
1 parent 25df275 commit b032c4d

File tree

44 files changed

+2968
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2968
-24
lines changed

incubator/binding-pgsql-kafka.spec/NOTICE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ This project includes:
1414
ICU4J under Unicode/ICU License
1515
Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception
1616
org.leadpony.justify under The Apache Software License, Version 2.0
17+
zilla::incubator::binding-pgsql.spec under Aklivity Community License Agreement
18+
zilla::specs::binding-kafka.spec under The Apache Software License, Version 2.0
19+
zilla::specs::binding-proxy.spec under The Apache Software License, Version 2.0
1720
zilla::specs::engine.spec under The Apache Software License, Version 2.0
1821

incubator/binding-pgsql-kafka.spec/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
<artifactId>engine.spec</artifactId>
4040
<version>${project.version}</version>
4141
</dependency>
42+
<dependency>
43+
<groupId>${project.groupId}</groupId>
44+
<artifactId>binding-pgsql.spec</artifactId>
45+
<version>${project.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>${project.groupId}</groupId>
49+
<artifactId>binding-kafka.spec</artifactId>
50+
<version>${project.version}</version>
51+
</dependency>
4252
<dependency>
4353
<groupId>junit</groupId>
4454
<artifactId>junit</artifactId>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Copyright 2021-2023 Aklivity Inc
3+
#
4+
# Licensed under the Aklivity Community License (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
#
8+
# https://www.aklivity.io/aklivity-community-license/
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
16+
---
17+
name: test
18+
catalogs:
19+
catalog0:
20+
type: test
21+
options:
22+
url: http://localhost:8081
23+
id: 1
24+
schema: |-
25+
{
26+
"type": "record",
27+
"name": "cities",
28+
"namespace": "dev",
29+
"fields": [
30+
{
31+
"name": "description",
32+
"type": string
33+
},
34+
{
35+
"name": "id",
36+
"type": string
37+
},
38+
{
39+
"name": "name",
40+
"type": string
41+
}
42+
]
43+
}
44+
bindings:
45+
app0:
46+
type: pgsql-kafka
47+
kind: proxy
48+
catalog:
49+
catalog0:
50+
- strategy: topic
51+
exit: app1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[
2+
{
3+
"op": "add",
4+
"path": "/$defs/binding/properties/type/enum/-",
5+
"value": "pgsql-kafka"
6+
},
7+
{
8+
"op": "add",
9+
"path": "/$defs/binding/allOf/-",
10+
"value":
11+
{
12+
"if":
13+
{
14+
"properties":
15+
{
16+
"type":
17+
{
18+
"const": "pgsql-kafka"
19+
}
20+
}
21+
},
22+
"then":
23+
{
24+
"properties":
25+
{
26+
"type":
27+
{
28+
"const": "pgsql-kafka"
29+
},
30+
"kind":
31+
{
32+
"enum": [ "proxy" ]
33+
},
34+
"vault": false,
35+
"options": false,
36+
"routes": false,
37+
"required":
38+
[
39+
"catalog",
40+
"exit"
41+
]
42+
}
43+
}
44+
}
45+
}
46+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#
2+
# Copyright 2021-2023 Aklivity Inc
3+
#
4+
# Licensed under the Aklivity Community License (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
#
8+
# https://www.aklivity.io/aklivity-community-license/
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
16+
connect "zilla://streams/app1"
17+
option zilla:window 8192
18+
option zilla:transmission "half-duplex"
19+
20+
write zilla:begin.ext ${kafka:beginEx()
21+
.typeId(zilla:id("kafka"))
22+
.request()
23+
.describeCluster()
24+
.includeAuthorizedOperations("false")
25+
.build()
26+
.build()}
27+
28+
connected
29+
30+
read zilla:begin.ext ${kafka:matchBeginEx()
31+
.typeId(zilla:id("kafka"))
32+
.response()
33+
.describeCluster()
34+
.throttle(0)
35+
.error(0)
36+
.clusterId("cluster-0")
37+
.controllerId(0)
38+
.broker()
39+
.brokerId(1)
40+
.host("broker1.example.com")
41+
.port(9092)
42+
.build()
43+
.authorizedOperations(0)
44+
.build()
45+
.build()}
46+
47+
write close
48+
read closed
49+
50+
connect "zilla://streams/app1"
51+
option zilla:window 8192
52+
option zilla:transmission "half-duplex"
53+
54+
write zilla:begin.ext ${kafka:beginEx()
55+
.typeId(zilla:id("kafka"))
56+
.request()
57+
.createTopics()
58+
.topic()
59+
.name("dev.cities")
60+
.partitionCount(1)
61+
.replicas(1)
62+
.assignment(0, 1)
63+
.config("cleanup.policy", "compact")
64+
.build()
65+
.timeout(30000)
66+
.validateOnly("false")
67+
.build()
68+
.build()}
69+
70+
connected
71+
72+
read zilla:begin.ext ${kafka:matchBeginEx()
73+
.typeId(zilla:id("kafka"))
74+
.response()
75+
.createTopics()
76+
.throttle(0)
77+
.topic()
78+
.name("dev.cities")
79+
.error(0)
80+
.build()
81+
.build()
82+
.build()}
83+
84+
write close
85+
read closed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#
2+
# Copyright 2021-2023 Aklivity Inc
3+
#
4+
# Licensed under the Aklivity Community License (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
#
8+
# https://www.aklivity.io/aklivity-community-license/
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
16+
property serverAddress "zilla://streams/app1"
17+
18+
accept ${serverAddress}
19+
option zilla:window 8192
20+
option zilla:transmission "half-duplex"
21+
22+
accepted
23+
24+
read zilla:begin.ext ${kafka:matchBeginEx()
25+
.typeId(zilla:id("kafka"))
26+
.request()
27+
.describeCluster()
28+
.includeAuthorizedOperations("false")
29+
.build()
30+
.build()}
31+
32+
connected
33+
34+
write zilla:begin.ext ${kafka:beginEx()
35+
.typeId(zilla:id("kafka"))
36+
.response()
37+
.describeCluster()
38+
.throttle(0)
39+
.error(0)
40+
.clusterId("cluster-0")
41+
.controllerId(0)
42+
.broker()
43+
.brokerId(1)
44+
.host("broker1.example.com")
45+
.port(9092)
46+
.build()
47+
.authorizedOperations(0)
48+
.build()
49+
.build()}
50+
write flush
51+
52+
read closed
53+
write close
54+
55+
accepted
56+
57+
read zilla:begin.ext ${kafka:matchBeginEx()
58+
.typeId(zilla:id("kafka"))
59+
.request()
60+
.createTopics()
61+
.topic()
62+
.name("dev.cities")
63+
.partitionCount(1)
64+
.replicas(1)
65+
.assignment(0, 1)
66+
.config("cleanup.policy", "compact")
67+
.build()
68+
.timeout(30000)
69+
.validateOnly("false")
70+
.build()
71+
.build()}
72+
73+
connected
74+
75+
write zilla:begin.ext ${kafka:beginEx()
76+
.typeId(zilla:id("kafka"))
77+
.response()
78+
.createTopics()
79+
.throttle(0)
80+
.topic()
81+
.name("dev.cities")
82+
.error(0)
83+
.build()
84+
.build()
85+
.build()}
86+
87+
write flush
88+
89+
read closed
90+
write close
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Copyright 2021-2023 Aklivity Inc
3+
#
4+
# Licensed under the Aklivity Community License (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
#
8+
# https://www.aklivity.io/aklivity-community-license/
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
16+
connect "zilla://streams/app1"
17+
option zilla:window 8192
18+
option zilla:transmission "half-duplex"
19+
20+
write zilla:begin.ext ${kafka:beginEx()
21+
.typeId(zilla:id("kafka"))
22+
.request()
23+
.deleteTopics()
24+
.topic("dev.cities")
25+
.timeout(30000)
26+
.build()
27+
.build()}
28+
29+
connected
30+
31+
read zilla:begin.ext ${kafka:matchBeginEx()
32+
.typeId(zilla:id("kafka"))
33+
.response()
34+
.deleteTopics()
35+
.throttle(0)
36+
.topic()
37+
.name("dev.cities")
38+
.error(0)
39+
.build()
40+
.build()
41+
.build()}
42+
43+
write close
44+
read closed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Copyright 2021-2023 Aklivity Inc
3+
#
4+
# Licensed under the Aklivity Community License (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
#
8+
# https://www.aklivity.io/aklivity-community-license/
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
16+
property serverAddress "zilla://streams/app1"
17+
18+
accept ${serverAddress}
19+
option zilla:window 8192
20+
option zilla:transmission "half-duplex"
21+
22+
accepted
23+
24+
read zilla:begin.ext ${kafka:matchBeginEx()
25+
.typeId(zilla:id("kafka"))
26+
.request()
27+
.deleteTopics()
28+
.topic("dev.cities")
29+
.timeout(30000)
30+
.build()
31+
.build()}
32+
33+
connected
34+
35+
write zilla:begin.ext ${kafka:beginEx()
36+
.typeId(zilla:id("kafka"))
37+
.response()
38+
.deleteTopics()
39+
.throttle(0)
40+
.topic()
41+
.name("dev.cities")
42+
.error(0)
43+
.build()
44+
.build()
45+
.build()}
46+
write flush
47+
48+
read closed
49+
write close

0 commit comments

Comments
 (0)