Repository navigation
feat: add mqtt v5 specific bindings to mqtt - #201
Conversation
There was a problem hiding this comment.
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.
KhudaDad414
left a comment
There was a problem hiding this comment.
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 |
jonaslagoni
left a comment
There was a problem hiding this comment.
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.
How come the contentType of the AsyncAPI Message object is not enough 🤔 Or rather whats the difference?
There was a problem hiding this comment.
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
| 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.
How is this different from the correlation ID? 🤔
There was a problem hiding this comment.
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.
|
we should merge to master, so it is changed for v2 too |
|
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 ? |
|
@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
mqttbinding. This is because we don't want to create new sets of bindings for each version of each protocol.Some general changes:
mqttbinding version to0.2.0mqtt5readme to indicate a consolidation of bindings undermqttonly.Here are specific fields being added:
sessionExpiryIntervaladded to the server bindingmaximumPacketSizeadded to the server bindingmessageExpiryIntervaladded to the operation bindingpayloadFormatIndicatoradded to the message bindingcorrelationDataadded to the message bindingcontentTypeadded to the message bindingresponseTopicadded 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