Skip to content

feat: add mqtt v5 specific bindings to mqtt - #201

Merged
asyncapi-bot merged 7 commits into
asyncapi:masterfrom
pearmaster:mqttv5-bindings
Dec 4, 2023
Merged

asyncapi-bot merged 7 commits into
asyncapi:masterfrom
pearmaster:mqttv5-bindings

Conversation

@pearmaster

Copy link
Copy Markdown
Contributor

Description
According to #199 (comment) , I'm only adding fields to the mqtt binding. This is because we don't want to create new sets of bindings for each version of each protocol.

Some general changes:

  • Increased mqtt binding version to 0.2.0
  • Added a column to the tables to indicate which MQTT versions the binding applied to.
  • Create a new message binding
  • Added a deprecation warning to the mqtt5 readme to indicate a consolidation of bindings under mqtt only.

Here are specific fields being added:

  • sessionExpiryInterval added to the server binding
  • maximumPacketSize added to the server binding
  • messageExpiryInterval added to the operation binding
  • payloadFormatIndicator added to the message binding
  • correlationData added to the message binding
  • contentType added to the message binding
  • responseTopic added to the message binding.

Related issue(s)
Fixes #199 by adding new v5 properties to the mqtt binding
Fixes #198 by adding maximum packet size

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

fmvilas
fmvilas previously approved these changes Jun 26, 2023
@fmvilas

fmvilas commented Jun 26, 2023

Copy link
Copy Markdown
Contributor

@dalelane @derberg @smoya @char0n would love to know your opinion.

Comment thread mqtt5/README.md Resolved
KhudaDad414
KhudaDad414 previously approved these changes Jul 5, 2023

@KhudaDad414 KhudaDad414 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation seems to match the JSON schema specification. 🙇

@pearmaster
pearmaster dismissed stale reviews from KhudaDad414 and fmvilas via a785000 July 21, 2023 16:56
derberg
derberg previously approved these changes Aug 11, 2023

@derberg derberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derberg
derberg requested a review from KhudaDad414 August 11, 2023 11:13
@smoya

smoya commented Aug 11, 2023 •

Copy link
Copy Markdown
Member

LGTM! 🚀🌔

Do we want to merge this into master and then adapt it to work with AsyncAPI v3? That already happened in #205, so we will need to update the binding in next-major-spec branch as well.
As an alternative, we could do the changes based on next-major-spec and will be released with v3 of the spec, which I think makes sense unless there is a really urgency.

Opinions? cc @jonaslagoni @dalelane @char0n @derberg

@KhudaDad414 KhudaDad414 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jonaslagoni jonaslagoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think there is reason to have this for v2 regardless of v3 is right around the corner.

Someone just needs to update these afterwards 😄

Comment thread mqtt/README.md
---|:---:|:---:|---
<a name="messageBindingObjectPayloadFormatIndicator"></a>`payloadFormatIndicator` | integer | 5 | Either: **0** (zero): Indicates that the payload is unspecified bytes, or **1**: Indicates that the payload is UTF-8 encoded character data. |
<a name="messageBindingObjectCorrelationData"></a>`correlationData` | [Schema Object][schemaObject] \| [Reference Object](referenceObject) | 5 | Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received.
<a name="messageBindingObjectContentType"></a>`contentType` | string | 5 | String describing the content type of the message payload. This should not conflict with the `contentType` field of the associated AsyncAPI Message object.

@jonaslagoni jonaslagoni Aug 14, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the contentType of the AsyncAPI Message object is not enough 🤔 Or rather whats the difference?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contentType of the Message object is a requirement of the payload format.

Providing a contentType message binding requires that the MQTTv5 PUBLISH packet include the "Content Type" property.

If we were talking HTTP, it would be the difference between requiring the payload to be JSON and requiring the HTTP headers include Content-Type: application/json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it 👍

Comment thread mqtt/README.md
Field Name | Type | MQTT Versions | Description
---|:---:|:---:|---
<a name="messageBindingObjectPayloadFormatIndicator"></a>`payloadFormatIndicator` | integer | 5 | Either: **0** (zero): Indicates that the payload is unspecified bytes, or **1**: Indicates that the payload is UTF-8 encoded character data. |
<a name="messageBindingObjectCorrelationData"></a>`correlationData` | [Schema Object][schemaObject] \| [Reference Object](referenceObject) | 5 | Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from the correlation ID? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as a correlation ID. correlationData is the MQTT term. When this binding property is provided in the spec, it signals that the correlation ID should be provided in the MQTTv5 PUBLISH property designated for such.

I'd love to update the correlation ID runtime expression to indicate that a protocol binding field should be used for the correlation ID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright 👍

@derberg

derberg commented Sep 4, 2023

Copy link
Copy Markdown
Member

we should merge to master, so it is changed for v2 too

@jonaslagoni

Copy link
Copy Markdown
Member

ping ping @pearmaster 🙂

@char0n char0n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smoya smoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀🌔

@smoya

smoya commented Nov 22, 2023

Copy link
Copy Markdown
Member

ping ping @pearmaster 🙂

I believe we can proceed with the merge of this PR. Nothing is expected from @pearmaster afaik. Anything else you expect @jonaslagoni ?

@jonaslagoni

Copy link
Copy Markdown
Member

@smoya nothing but the JSON Schema files need to be moved to spec-json-schema repo 🙂

@derberg

derberg commented Dec 4, 2023

Copy link
Copy Markdown
Member

@smoya I just opened asyncapi/spec-json-schemas#464 so I guess we can merge this one and the other PR?

@smoya

smoya commented Dec 4, 2023

Copy link
Copy Markdown
Member

/rtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MQTT5 CONNECT and PUBLISH Properties add message size/length to mqtt and mqtt5

8 participants