asyncapi / bindings

AsyncAPI bindings specifications
Apache License 2.0
72 stars 75 forks source link

MQTT5 CONNECT and PUBLISH Properties #199

Closed pearmaster closed 11 months ago

pearmaster commented 1 year ago

Reason/Context

One of the defining features of MQTTv5 are Properties. (otherwise, you'd probably just use MQTT v3). Properties can be included in almost all MQTT packet types, and can form a significant part of an MQTTv5 API contract.

In issue https://github.com/asyncapi/spec/issues/878 @fmvilas suggested that bindings are the appropriate construct for describing properties.

For more information, this page lists properties by packet type: http://www.steves-internet-guide.com/mqttv5-properties/

Description

I suggest adding additional fields to the MQTT5 server binding for MQTT CONNECT packets:

I suggest adding additional fields to the MQTT5 message bindings for MQTT PUBLISH packets:

I have a pull request that is about ready to go once this issue is approved (according to the contributing guidelines)

Side note: I've used the word "packet" above when the correct MQTT terminology is "message" to disambiguate from AsyncAPI "message" objects.

github-actions[bot] commented 1 year ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup 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.

tomkralidis commented 1 year ago

Relation to #198

pearmaster commented 1 year ago

@fmvilas While I'm looking at this, I see that mqtt5 doesn't include the bindings that mqtt allows. Do you envision bindings being able to stack like this?:

servers:
  prod:
    bindings:
      mqtt:
        clientId: guest
      mqtt5:
        sessionExpiryInterval: 60

or should the relevant mqtt bindings be copied to the set of mqtt5 bindings?

fmvilas commented 1 year ago

Do you envision bindings being able to stack like this?

I think we somehow defined mqtt for MQTT <5 and mqtt5 for version 5 but, to be honest, I think this is a mistake we did in the past and both bindings should be merged into mqtt. It should be ok to put MQTT 5 stuff into the mqtt binding. We should just make it clear that it's only supported in versions >=5.

pearmaster commented 1 year ago

I'll adapt my MR to merge both binding definitions (plus the new stuff) into mqtt.

fmvilas commented 1 year ago

Awesome, thanks! 🙏

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: