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

feat: apache Pulsar bindings #173

Merged
merged 26 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
620c7e7
Create README.md
VisualBean Nov 10, 2022
1f8e582
Update README.md
VisualBean Nov 10, 2022
32d72c4
fix a few examples and json schema
VisualBean Nov 16, 2022
adb3fdf
refactored slightly
VisualBean Nov 17, 2022
1f73ec2
forgot to add namespace to example
VisualBean Nov 17, 2022
76c03b2
Update pulsar/json_schemas/server.json
VisualBean Nov 19, 2022
ad6d318
add ttl and required/optional
VisualBean Nov 21, 2022
e06a55b
add geo replication to channel binding
VisualBean Nov 21, 2022
bf7ba3b
missing examples and expanded description text.
VisualBean Nov 22, 2022
483adfe
Merge branch 'master' into patch-1
VisualBean Nov 23, 2022
ea5a86f
Update README.md
VisualBean Nov 24, 2022
78fd6a8
Update pulsar/README.md
VisualBean Nov 24, 2022
583904d
optional binding version
VisualBean Nov 25, 2022
a0783d2
Merge branch 'master' into patch-1
VisualBean Nov 28, 2022
d3e3ff1
Apply suggestions from code review
VisualBean Nov 29, 2022
48b72e4
fix minor issues
VisualBean Nov 29, 2022
b10fbae
Update pulsar/json_schemas/channel.json
VisualBean Nov 29, 2022
913c27f
missing column header
VisualBean Nov 29, 2022
914f3cb
Merge remote-tracking branch 'origin/patch-1' into patch-1
VisualBean Nov 29, 2022
e74b660
Update pulsar/json_schemas/server.json
VisualBean Nov 29, 2022
18307fa
moved retention definition up under channel
VisualBean Nov 29, 2022
9b8fddc
Update pulsar/README.md
VisualBean Nov 29, 2022
9c101b8
new table structure
VisualBean Nov 30, 2022
4d5241a
Update CODEOWNERS
VisualBean Dec 1, 2022
e6e05d5
Update pulsar/README.md
VisualBean Dec 2, 2022
bc47e8f
Merge branch 'master' into patch-1
VisualBean Dec 6, 2022
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
86 changes: 86 additions & 0 deletions pulsar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Pulsar Bindings
This document defines how to describe Apache Pulsar specific information with AsyncAPI.

<a name="version"></a>

## Version

Current version is `0.1.0`.

<a name="server"></a>
## Server Binding Object

This object contains information about the server representation in Pulsar.

##### Fixed Fields

Field Name | Type | Description | Applicability [default] |
---|:---:|:---|:---|
`tenant` | String | The pulsar tenant. If omitted, "public" MUST be assumed. | OPTIONAL [`public`] |
`bindingVersion` | String | The version of this binding. If omitted, "latest" MUST be assumed. | OPTIONAL [`latest`] |

##### Example

```yaml
servers:
production:
bindings:
pulsar:
tenant: contoso
bindingVersion: '0.1.0'
```

<a name="channel"></a>
## Channel Binding Object
This object contains information about the channel representation in Pulsar

##### Fixed Fields

Field Name | Type | Description | Applicability [default] |
---|:---:|:---|:---|
`namespace` | String | The namespace the channel is associated with. | REQUIRED |
`persistence` | String | Persistence of the topic in Pulsar. It MUST be either `persistent` or `non-persistent`. | REQUIRED |
`compaction`| Integer | Topic compaction threshold given in Megabytes. | OPTIONAL |
`geo-replication` | String[] | A list of clusters the topic is replicated to. | OPTIONAL |
`retention` | [Retention Definition Object](#retention-definition-object) | Topic retention policy. | OPTIONAL |
`ttl` | Integer | Message time-to-live in seconds. | OPTIONAL |
`deduplication` | Boolean | Message deduplication. When true, it ensures that each message produced on Pulsar topics is persisted to disk only once. | OPTIONAL |
`bindingVersion` | String | The version of this binding. If omitted, "latest" MUST be assumed. | OPTIONAL [`latest`] |

<a name="retention-definition-object"></a>
### Retention Definition Object
The `Retention Definition Object` is used to describe the Pulsar [Retention](https://pulsar.apache.org/docs/cookbooks-retention-expiry/) policy. If retention is specified, both fields are mandatory.

Field Name | Type | Description | Applicability [default] |
---|:---:|:---|:---|
`time`|Integer| Time given in Minutes. | OPTIONAL [`0`]
`size`|Integer| Size given in MegaBytes. | OPTIONAL [`0`]

##### Example

```yaml
channels:
user-signedup:
bindings:
pulsar:
namespace: 'staging'
persistence: 'persistent'
compaction: 1000
geo-replication:
- 'us-east1'
- 'us-west1'
retention:
time: 7
size: 1000
ttl: 360
deduplication: false
bindingVersion: '0.1.0'
```

<a name="operation"></a>
## Operation binding fields
This object MUST NOT contain any properties. Its name is reserved for future use.

<a name="message"></a>
## Message binding fields
This object MUST NOT contain any properties. Its name is reserved for future use.
91 changes: 91 additions & 0 deletions pulsar/json_schemas/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/pulsar/channel.json",
"title": "Channel Schema",
"description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v4.0.0/schemas/2.5.0.json#/definitions/http://asyncapi.com/definitions/2.5.0/specificationExtension.json"
}
},
"required": [ "namespace", "persistence" ],
"properties": {
"namespace": {
"type": "string",
"description": "The namespace, the channel is associated with."
},
"persistence": {
"type": "string",
"enum": [
"persistent",
"non-persistent"
],
"description": "persistence of the topic in Pulsar."
},
"compaction": {
"type": "integer",
"minimum": 0,
"description": "Topic compaction threshold given in MB"
},
"geo-replication": {
"type": "array",
"description": "A list of clusters the topic is replicated to.",
"items": {
"type": "string"
}
},
"retention": {
"type": "object",
"additionalProperties": false,
"properties": {
"time": {
"type": "integer",
"minimum": 0,
"description": "Time given in Minutes. `0` = Disable message retention."
},
"size": {
"type": "integer",
"minimum": 0,
"description": "Size given in MegaBytes. `0` = Disable message retention."
}
}
},
"ttl": {
"type": "integer",
"description": "TTL in seconds for the specified topic"
},
"deduplication": {
"type": "boolean",
"description": "Whether deduplication of events is enabled or not."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"namespace": "ns1",
"persistence": "persistent",
"compaction": 1000,
"retention": {
"time": 15,
"size": 1000
},
"ttl": 360,
"geo-replication": [
"us-west",
"us-east"
],
"deduplication": true,
"bindingVersion": "0.1.0"
}
]
}

32 changes: 32 additions & 0 deletions pulsar/json_schemas/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/pulsar/server.json",
"title": "Server Schema",
"description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"tenant": {
"type": "string",
"description": "The pulsar tenant. If omitted, 'public' MUST be assumed."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
},
"examples": [
{
"tenant": "contoso",
"bindingVersion": "0.1.0"
}
]
}