Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema fixes + avoiding duplicate reply begin on mqtt-kafka subscribe stream #872

Merged
merged 11 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions incubator/binding-asyncapi.spec/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ This project includes:
zilla::specs::binding-mqtt-kafka.spec under Aklivity Community License Agreement
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::binding-tcp.spec under The Apache Software License, Version 2.0
zilla::specs::binding-tls.spec under The Apache Software License, Version 2.0
zilla::specs::engine.spec under The Apache Software License, Version 2.0
zilla::specs::vault-filesystem.spec under The Apache Software License, Version 2.0


This project also includes code under copyright of the following entities:
Expand Down
10 changes: 10 additions & 0 deletions incubator/binding-asyncapi.spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
<artifactId>binding-mqtt-kafka.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>binding-tcp.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>binding-tls.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,24 @@
"maxProperties": 1
}
},
"tcp": "#/$defs/binding/tcp/options",
"tls": "#/$defs/binding/tls/options",
"tcp":
{
"$ref": "#/$defs/options/binding/tcp"
},
"tls":
{
"$ref": "#/$defs/options/binding/tls"
},
"http":
{
"title": "Http",
"type": "object",
"properties":
{
"authorization": "$defs/options/binding/http/authorization"
"authorization":
{
"$ref": "#/$defs/options/binding/http/authorization"
}
},
"additionalProperties": false
},
Expand All @@ -70,7 +79,10 @@
"type": "object",
"properties":
{
"sasl": "$defs/options/binding/kafka/sasl"
"sasl":
{
"$ref": "#/$defs/options/binding/kafka/sasl"
}
},
"additionalProperties": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public class SchemaTest
@Rule
public final ConfigSchemaRule schema = new ConfigSchemaRule()
.schemaPatch("io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/tls/schema/tls.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/tcp/schema/tcp.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/http/schema/http.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/engine/schema/vault/test.schema.patch.json")
.configurationRoot("io/aklivity/zilla/specs/binding/asyncapi/config");

Expand Down
5 changes: 5 additions & 0 deletions incubator/binding-asyncapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@
</artifactItem>
</artifactItems>
<includes>io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.schema.patch.json,
io/aklivity/zilla/specs/binding/mqtt/kafka/schema/mqtt.kafka.schema.patch.json,
io/aklivity/zilla/specs/binding/http/schema/http.schema.patch.json,
io/aklivity/zilla/specs/binding/kafka/schema/kafka.schema.patch.json,
io/aklivity/zilla/specs/binding/tcp/schema/tcp.schema.patch.json,
io/aklivity/zilla/specs/binding/tls/schema/tls.schema.patch.json,
io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.2.6.0.schema.json,
io/aklivity/zilla/specs/binding/asyncapi/schema/asyncapi.3.0.1.schema.json
</includes>
Expand Down
3 changes: 3 additions & 0 deletions incubator/binding-openapi-asyncapi.spec/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ This project includes:
zilla::specs::binding-mqtt-kafka.spec under Aklivity Community License Agreement
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::binding-tcp.spec under The Apache Software License, Version 2.0
zilla::specs::binding-tls.spec under The Apache Software License, Version 2.0
zilla::specs::engine.spec under The Apache Software License, Version 2.0
zilla::specs::vault-filesystem.spec under The Apache Software License, Version 2.0


This project also includes code under copyright of the following entities:
Expand Down
5 changes: 5 additions & 0 deletions incubator/binding-openapi-asyncapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<artifactId>binding-http-kafka</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.aklivity.zilla</groupId>
<artifactId>binding-mqtt-kafka</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.aklivity.zilla</groupId>
<artifactId>binding-http</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions incubator/binding-openapi.spec/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ This project includes:
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-proxy.spec under The Apache Software License, Version 2.0
zilla::specs::binding-tcp.spec under The Apache Software License, Version 2.0
zilla::specs::binding-tls.spec under The Apache Software License, Version 2.0
zilla::specs::engine.spec under The Apache Software License, Version 2.0
zilla::specs::vault-filesystem.spec under The Apache Software License, Version 2.0


This project also includes code under copyright of the following entities:
Expand Down
10 changes: 10 additions & 0 deletions incubator/binding-openapi.spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
<artifactId>binding-http.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>binding-tls.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>binding-tcp.spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@
{
"properties":
{
"tcp": "#/$defs/binding/tcp/options",
"tls": "#/$defs/binding/tls/options",
"tcp":
{
"$ref": "#/$defs/options/binding/tcp"
},
"tls":
{
"$ref": "#/$defs/options/binding/tls"
},
"http":
{
"title": "Http",
"type": "object",
"properties":
{
"authorization": "$defs/options/binding/http/authorization"
"authorization":
{
"$ref": "#/$defs/options/binding/http/authorization"
}
},
"additionalProperties": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class SchemaTest
@Rule
public final ConfigSchemaRule schema = new ConfigSchemaRule()
.schemaPatch("io/aklivity/zilla/specs/binding/openapi/schema/openapi.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/tls/schema/tls.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/tcp/schema/tcp.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/binding/http/schema/http.schema.patch.json")
.schemaPatch("io/aklivity/zilla/specs/engine/schema/vault/test.schema.patch.json")
.configurationRoot("io/aklivity/zilla/specs/binding/openapi/config");

Expand All @@ -42,6 +45,14 @@ public void shouldValidateServer()
assertThat(config, not(nullValue()));
}

@Test
public void shouldValidateServerSecure()
{
JsonObject config = schema.validate("server-secure.yaml");

assertThat(config, not(nullValue()));
}

@Test
public void shouldValidateClient()
{
Expand Down
3 changes: 3 additions & 0 deletions incubator/binding-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@
</artifactItem>
</artifactItems>
<includes>io/aklivity/zilla/specs/binding/openapi/schema/openapi.schema.patch.json,
io/aklivity/zilla/specs/binding/http/schema/http.schema.patch.json,
io/aklivity/zilla/specs/binding/tcp/schema/tcp.schema.patch.json,
io/aklivity/zilla/specs/binding/tls/schema/tls.schema.patch.json,
io/aklivity/zilla/specs/binding/openapi/schema/openapi.3.0.3.schema.json,
io/aklivity/zilla/specs/binding/openapi/schema/openapi.3.1.0.schema.json
</includes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,13 @@ private void doMqttBegin(
long authorization,
long affinity)
{
state = MqttKafkaState.openingReply(state);
if (!MqttKafkaState.replyOpening(state))
{
state = MqttKafkaState.openingReply(state);

doBegin(mqtt, originId, routedId, replyId, replySeq, replyAck, replyMax,
traceId, authorization, affinity);
doBegin(mqtt, originId, routedId, replyId, replySeq, replyAck, replyMax,
traceId, authorization, affinity);
}
}

private void doMqttData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@
}
]
},
"authorization": "$defs/options/binding/http/authorization",
"authorization":
{
"$ref": "#/$defs/options/binding/http/authorization"
},
"overrides":
{
"title": "Overrides",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@
"pattern": "([^\\:]+):(\\d+)"
}
},
"sasl": "$defs/options/binding/kafka/sasl"
"sasl":
{
"$ref": "#/$defs/options/binding/kafka/sasl"
}
},
"additionalProperties": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"if":
{
"properties":
"properties":
{
"type":
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,7 @@
"vault": false,
"options":
{
"properties":
{
"host":
{
"title": "Host",
"type": "string"
},
"port":
{
"title": "Port",
"oneOf":
[
{
"type": "integer"
},
{
"type": "string",
"pattern": "^\\d+(-\\d+)?$"
},
{
"type": "array",
"items":
{
"oneOf":
[
{
"type": "integer"
},
{
"type": "string",
"pattern": "^\\d+(-\\d+)?$"
}
]
}
}
]
}
},
"additionalProperties": false
"$ref": "#/$defs/options/binding/tcp"
},
"routes":
{
Expand Down Expand Up @@ -195,5 +157,51 @@
]
}
}
},
{
"op": "add",
"path": "/$defs/options/binding/tcp",
"value":
{
"properties":
{
"host":
{
"title": "Host",
"type": "string"
},
"port":
{
"title": "Port",
"oneOf":
[
{
"type": "integer"
},
{
"type": "string",
"pattern": "^\\d+(-\\d+)?$"
},
{
"type": "array",
"items":
{
"oneOf":
[
{
"type": "integer"
},
{
"type": "string",
"pattern": "^\\d+(-\\d+)?$"
}
]
}
}
]
}
},
"additionalProperties": false
}
}
]
Loading