-
-
Notifications
You must be signed in to change notification settings - Fork 75
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: add mqtt v5 specific bindings to mqtt #201
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 🙇
Co-authored-by: Lukasz Gornicki <[email protected]>
LGTM! 🚀🌔 Do we want to merge this into Opinions? cc @jonaslagoni @dalelane @char0n @derberg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
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 😄
---|:---:|:---:|--- | ||
<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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it 👍
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. |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright 👍
we should merge to master, so it is changed for v2 too |
ping ping @pearmaster 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀🌔
I believe we can proceed with the merge of this PR. Nothing is expected from @pearmaster afaik. Anything else you expect @jonaslagoni ? |
@smoya nothing but the JSON Schema files need to be moved to spec-json-schema repo 🙂 |
@smoya I just opened asyncapi/spec-json-schemas#464 so I guess we can merge this one and the other PR? |
/rtm |
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:
mqtt
binding version to0.2.0
mqtt5
readme to indicate a consolidation of bindings undermqtt
only.Here are specific fields being added:
sessionExpiryInterval
added to the server bindingmaximumPacketSize
added to the server bindingmessageExpiryInterval
added to the operation bindingpayloadFormatIndicator
added to the message bindingcorrelationData
added to the message bindingcontentType
added to the message bindingresponseTopic
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