Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
65aad28
skeleton
bmaidics Jan 25, 2024
33be2a0
checkpoint
bmaidics Jan 26, 2024
a71c350
checkpoint
bmaidics Jan 30, 2024
db6997f
checkpoint
bmaidics Jan 30, 2024
0574abe
checkpoint
bmaidics Feb 3, 2024
63136cd
checkpoint
bmaidics Feb 5, 2024
0833f4d
checkpoint
bmaidics Feb 6, 2024
ae38add
Checkpoint
bmaidics Feb 7, 2024
e8f93fc
check
bmaidics Feb 8, 2024
4984c85
Checkpoint
bmaidics Feb 8, 2024
046583b
some fixes
bmaidics Feb 8, 2024
ffd9900
Merge remote-tracking branch 'upstream/develop' into asyncapi_mqtt
bmaidics Feb 9, 2024
a366947
checkpoint
bmaidics Feb 12, 2024
54aea97
Address review items
bmaidics Feb 12, 2024
51f039c
Merge remote-tracking branch 'upstream/develop' into asyncapi_mqtt
bmaidics Feb 12, 2024
ee96b7d
remove files
bmaidics Feb 12, 2024
504af3e
Reviews
bmaidics Feb 13, 2024
3ca1ffb
Add dependency to docker
bmaidics Feb 13, 2024
084c7ff
Fix
bmaidics Feb 13, 2024
24a2897
Fixes
bmaidics Feb 14, 2024
f7b2b50
Fix pom
bmaidics Feb 15, 2024
d13162d
Add asyncapi schema validation
bmaidics Feb 16, 2024
87d8ae6
Merge remote-tracking branch 'upstream/develop' into asyncapi_mqtt
bmaidics Feb 16, 2024
e484222
first commit
bmaidics Feb 13, 2024
607ea1a
checkpoint
bmaidics Feb 14, 2024
cc72a7a
REVERT BEFORE MERGE: Akram's HTTP changes
bmaidics Feb 14, 2024
6f3b371
checkpoint
bmaidics Feb 14, 2024
3f9c72f
REVERT THIS AS WELL
bmaidics Feb 14, 2024
3ad70d6
checkpoint
bmaidics Feb 15, 2024
8a8aae2
Fix tests
bmaidics Feb 15, 2024
12f7619
Test http
bmaidics Feb 15, 2024
049e595
Review items
bmaidics Feb 20, 2024
3267a92
Merge branch 'asyncapi_mqtt' into http_asyncapi
bmaidics Feb 20, 2024
0a2fb4e
Merge fixes
bmaidics Feb 20, 2024
7d05a57
Merge remote-tracking branch 'upstream/develop' into asyncapi_mqtt
bmaidics Feb 21, 2024
4d59803
Use binding.qvault
bmaidics Feb 21, 2024
dd71f47
Merge branch 'asyncapi_mqtt' into http_asyncapi
bmaidics Feb 21, 2024
18acd92
Review fixes
bmaidics Feb 21, 2024
9056e04
Add schema, builders
bmaidics Feb 16, 2024
3df787a
Client done?
bmaidics Feb 19, 2024
8ca3a72
Checkpoint
bmaidics Feb 21, 2024
b79279e
feedbacks
bmaidics Feb 22, 2024
d99bb51
Merge remote-tracking branch 'upstream/develop' into http_asyncapi
bmaidics Feb 22, 2024
285f1d3
Merge branch 'http_asyncapi' into kafka_client_asyncapi
bmaidics Feb 22, 2024
d694e5b
Fix
bmaidics Feb 22, 2024
8df7787
Merge remote-tracking branch 'upstream/develop' into kafka_client_asy…
bmaidics Feb 26, 2024
efbdf81
Merge fixes
bmaidics Feb 26, 2024
6706138
Remove unnecessary files
bmaidics Feb 26, 2024
3801e01
fix
bmaidics Feb 26, 2024
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
1 change: 1 addition & 0 deletions incubator/binding-asyncapi.spec/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This project includes:
Jakarta JSON Processing API under Eclipse Public License 2.0 or GNU General Public License, version 2 with the GNU Classpath Exception
org.leadpony.justify under The Apache Software License, Version 2.0
zilla::specs::binding-http.spec under The Apache Software License, Version 2.0
zilla::specs::binding-kafka.spec under The Apache Software License, Version 2.0
zilla::specs::binding-mqtt.spec under The Apache Software License, Version 2.0
zilla::specs::binding-proxy.spec under The Apache Software License, Version 2.0
zilla::specs::engine.spec under The Apache Software License, Version 2.0
Expand Down
7 changes: 6 additions & 1 deletion incubator/binding-asyncapi.spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
<artifactId>binding-http.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>binding-kafka.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -88,7 +93,7 @@
<artifactId>flyweight-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<scopeNames>core http mqtt asyncapi</scopeNames>
<scopeNames>core http mqtt kafka asyncapi</scopeNames>
<packageName>io.aklivity.zilla.specs.binding.asyncapi.internal.types</packageName>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ bindings:
vault: test0
options:
specs:
- mqtt/asyncapi.yaml
- kafka/asyncapi.yaml
tcp:
host: localhost
port:
- 7183
- 9092
tls:
trust:
- serverca
trustcacerts: true
sni:
- mqtt.example.net
- kafka.example.net
alpn:
- mqtt
- kafka
kafka:
sasl:
mechanism: plain
username: username
password: password
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ bindings:
kind: client
options:
specs:
- mqtt/asyncapi.yaml
- kafka/asyncapi.yaml
tcp:
host: localhost
port:
- 7183
- 9092
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

asyncapi: 3.0.0
info:
title: Streetlights Kafka API
version: 1.0.0
description: "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off \U0001F303\n* Dim a specific streetlight \U0001F60E\n* Receive real-time information about environmental lighting conditions \U0001F4C8\n"
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
defaultContentType: application/json
servers:
scram-connections:
host: 'test.mykafkacluster.org:18092'
protocol: kafka-secure
description: Test broker secured with scramSha256
security:
- $ref: '#/components/securitySchemes/saslScram'
tags:
- name: 'env:test-scram'
description: >-
This environment is meant for running internal tests through
scramSha256
- name: 'kind:remote'
description: This server is a remote server. Not exposed by the application
- name: 'visibility:private'
description: This resource is private and only available to certain users
channels:
lightingMeasured:
address: 'smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measured'
messages:
lightMeasured:
$ref: '#/components/messages/lightMeasured'
description: The topic on which measured values may be produced and consumed.
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
lightTurnOn:
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.on'
messages:
turnOn:
$ref: '#/components/messages/turnOnOff'
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
lightTurnOff:
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.turn.off'
messages:
turnOff:
$ref: '#/components/messages/turnOnOff'
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
lightsDim:
address: 'smartylighting.streetlights.1.0.action.{streetlightId}.dim'
messages:
dimLight:
$ref: '#/components/messages/dimLight'
parameters:
streetlightId:
$ref: '#/components/parameters/streetlightId'
operations:
receiveLightMeasurement:
action: receive
channel:
$ref: '#/channels/lightingMeasured'
summary: >-
Inform about environmental lighting conditions of a particular
streetlight.
traits:
- $ref: '#/components/operationTraits/kafka'
messages:
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
turnOn:
action: send
channel:
$ref: '#/channels/lightTurnOn'
traits:
- $ref: '#/components/operationTraits/kafka'
messages:
- $ref: '#/channels/lightTurnOn/messages/turnOn'
turnOff:
action: send
channel:
$ref: '#/channels/lightTurnOff'
traits:
- $ref: '#/components/operationTraits/kafka'
messages:
- $ref: '#/channels/lightTurnOff/messages/turnOff'
dimLight:
action: send
channel:
$ref: '#/channels/lightsDim'
traits:
- $ref: '#/components/operationTraits/kafka'
messages:
- $ref: '#/channels/lightsDim/messages/dimLight'
components:
messages:
lightMeasured:
name: lightMeasured
title: Light measured
summary: >-
Inform about environmental lighting conditions of a particular
streetlight.
contentType: application/json
traits:
- $ref: '#/components/messageTraits/commonHeaders'
payload:
$ref: '#/components/schemas/lightMeasuredPayload'
turnOnOff:
name: turnOnOff
title: Turn on/off
summary: Command a particular streetlight to turn the lights on or off.
traits:
- $ref: '#/components/messageTraits/commonHeaders'
payload:
$ref: '#/components/schemas/turnOnOffPayload'
dimLight:
name: dimLight
title: Dim light
summary: Command a particular streetlight to dim the lights.
traits:
- $ref: '#/components/messageTraits/commonHeaders'
payload:
$ref: '#/components/schemas/dimLightPayload'
schemas:
lightMeasuredPayload:
type: object
properties:
lumens:
type: integer
minimum: 0
description: Light intensity measured in lumens.
sentAt:
$ref: '#/components/schemas/sentAt'
turnOnOffPayload:
type: object
properties:
command:
type: string
enum:
- 'on'
- 'off'
description: Whether to turn on or off the light.
sentAt:
$ref: '#/components/schemas/sentAt'
dimLightPayload:
type: object
properties:
percentage:
type: integer
description: Percentage to which the light should be dimmed to.
minimum: 0
maximum: 100
sentAt:
$ref: '#/components/schemas/sentAt'
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
securitySchemes:
saslScram:
type: scramSha256
description: Provide your username and password for SASL/SCRAM authentication
parameters:
streetlightId:
description: The ID of the streetlight.
messageTraits:
commonHeaders:
headers:
type: object
properties:
my-app-header:
type: integer
minimum: 0
maximum: 100
operationTraits:
kafka:
bindings:
kafka:
clientId:
type: string
enum:
- my-app-id

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@
"authorization": "$defs/options/binding/http/authorization"
},
"additionalProperties": false
},
"kafka":
{
"title": "Kafka",
"type": "object",
"properties":
{
"sasl": "$defs/options/binding/kafka/sasl"
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

property deltaMillis 0L
property newTimestamp ${kafka:timestamp() + deltaMillis}

connect "zilla://streams/asyncapi0"
option zilla:window 8192
option zilla:transmission "half-duplex"

write zilla:begin.ext ${asyncapi:beginEx()
.typeId(zilla:id("asyncapi"))
.extension(kafka:beginEx()
.typeId(zilla:id("kafka"))
.merged()
.capabilities("PRODUCE_ONLY")
.topic("test")
.ackMode("LEADER_ONLY")
.build()
.build())
.build()}

connected

write zilla:data.ext ${kafka:dataEx()
.typeId(zilla:id("kafka"))
.merged()
.produce()
.timestamp(newTimestamp)
.partition(0, 1)
.build()
.build()}
write "Hello, world"
write flush
Loading