Skip to content

Mqtt implementation needs improvements #457

Open
@relu91

Description

@relu91

I've recently worked on #456 and I had the opportunity to have a look into the current implementation of the MQTT binding. I think it can be improved in multiple points, some of which may impact also the binding specification.

  • Missing the ability to self-host the broker. I think that the server implementation should be able to self host the broker not only connect to an external remote node.
  • Missing a correct definition of the configuration parameters. For reference please have a look into the current HTTP implementation where the client has a properly defined interface in the http.ts for the config object.
  • Client implementation lacks the ability to connect using user and password
  • Proper definition of form parameters. Now QoS and retain are not really used in the code. We need to implement a proper model in the binding document.
  • Unit tests are not self-contained but depend upon core libraries. I think we should just test the protocol APIs rather than the full stack in a binding package. Or if we want to test the full stack we should provide smaller tests that just focus on binding APIs.
  • Refactor the expose function in smaller units (but this is a problem of almost every binding).
  • Refactor client implementation to have the same code style of other clients (e.g., it uses method = () => {} instead of public method(){})

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-mqttIssues related to mqtt protocol bindingenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions