Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
some mqtt-kafka scenarios
  • Loading branch information
bmaidics committed Dec 2, 2023
commit 27c702ed53517b940bb3ad1011c635fe6191fa09
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

connect "zilla://streams/kafka0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${kafka:beginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "EXACTLY_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected


connect "zilla://streams/kafka0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${kafka:beginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.groupId("client")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_MOST_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected


read zilla:data.ext ${kafka:matchDataEx()
.typeId(zilla:id("kafka"))
.merged()
.fetch()
.timestamp(kafka:timestamp())
.filters(1)
.partition(0, 1, 2)
.progress(0, 2)
.progress(1, 1)
.key("sensor/one")
.header("zilla:filter", "sensor")
.header("zilla:filter", "one")
.header("zilla:local", "client")
.header("zilla:format", "TEXT")
.header("zilla:qos", "EXACTLY_ONCE")
.build()
.build()
.build()}
read "message"

write advise zilla:flush ${kafka:flushEx()
.typeId(zilla:id("kafka"))
.merged()
.consumer()
.partition(0, 2)
.build()
.build()}

read advised zilla:flush ${kafka:matchFlushEx()
.typeId(zilla:id("kafka"))
.merged()
.consumer()
.partition(0, 2)
.build()
.build()}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#
# Copyright 2021-2023 Aklivity Inc
#
# Licensed under the Aklivity Community License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://www.aklivity.io/aklivity-community-license/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

accept "zilla://streams/kafka0"
option zilla:window 8192
option zilla:transmission "duplex"

accepted

read zilla:begin.ext ${kafka:matchBeginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "EXACTLY_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected


accepted

read zilla:begin.ext ${kafka:matchBeginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.groupId("client")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_MOST_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected

write zilla:data.ext ${kafka:dataEx()
.typeId(zilla:id("kafka"))
.merged()
.fetch()
.timestamp(kafka:timestamp())
.filters(1)
.partition(0, 1, 2)
.progress(0, 2)
.progress(1, 1)
.key("sensor/one")
.header("zilla:filter", "sensor")
.header("zilla:filter", "one")
.header("zilla:local", "client")
.header("zilla:format", "TEXT")
.header("zilla:qos", "EXACTLY_ONCE")
.build()
.build()
.build()}
write "message"
write flush

read advised zilla:flush ${kafka:matchFlushEx()
.typeId(zilla:id("kafka"))
.merged()
.consumer()
.partition(0, 2)
.build()
.build()}

write advise zilla:flush ${kafka:flushEx()
.typeId(zilla:id("kafka"))
.merged()
.consumer()
.partition(0, 2)
.build()
.build()}

Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,57 @@ write zilla:begin.ext ${kafka:beginEx()
.sequence("one")
.build()
.build()
.header("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "EXACTLY_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected

read zilla:data.ext ${kafka:matchDataEx()

connect "zilla://streams/kafka0"
option zilla:window 8192
option zilla:transmission "duplex"

write zilla:begin.ext ${kafka:beginEx()
.typeId(zilla:id("kafka"))
.merged()
.filters(1)
.partition(0, 1, 2)
.progress(0, 2)
.progress(1, 1)
.key("sensor/one")
.header("zilla:filter", "sensor")
.header("zilla:filter", "one")
.header("zilla:local", "client")
.header("zilla:format", "TEXT")
.header("zilla:qos", "AT_LEAST_ONCE")
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.groupId("client")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_MOST_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected


read zilla:data.ext ${kafka:matchDataEx()
.typeId(zilla:id("kafka"))
.merged()
.fetch()
.timestamp(kafka:timestamp())
.filters(1)
.partition(0, 1, 2)
.progress(0, 2)
.progress(1, 1)
.key("sensor/one")
.header("zilla:filter", "sensor")
.header("zilla:filter", "one")
.header("zilla:local", "client")
.header("zilla:format", "TEXT")
.header("zilla:qos", "AT_LEAST_ONCE")
.build()
.build()
.build()}
read "message"

write advise zilla:flush ${kafka:flushEx()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ accept "zilla://streams/kafka0"
option zilla:window 8192
option zilla:transmission "duplex"

accepted

read zilla:begin.ext ${kafka:matchBeginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("FETCH_ONLY")
.topic("mqtt-messages")
.filter()
.headers("zilla:filter")
.sequence("sensor")
.sequence("one")
.build()
.build()
.headerNot("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "EXACTLY_ONCE")
.evaluation("EAGER")
.build()
.build()}

connected


accepted

read zilla:begin.ext ${kafka:matchBeginEx()
Expand All @@ -31,7 +53,7 @@ read zilla:begin.ext ${kafka:matchBeginEx()
.sequence("one")
.build()
.build()
.header("zilla:qos", "AT_LEAST_ONCE")
.headerNot("zilla:qos", "AT_MOST_ONCE")
.evaluation("EAGER")
.build()
.build()}
Expand Down
Loading