Giter Site home page Giter Site logo

javasabr / mqtt-broker Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 730 KB

Java implementation of MQTT 5.0 compatible broker based on RLib library.

License: GNU General Public License v3.0

Java 70.43% Groovy 29.57%
mqtt-broker mqtt java nio java-13 spring-boot spock-framework springframework rlib groovy

mqtt-broker's People

Contributors

crazyrokr avatar javasabr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

magicnana999

mqtt-broker's Issues

Implement Simple Subscription Service

  1. Create an interface SubscriptionService with methods:
    1.subscribe(mqttClient, topic)
    2.unsubscribe(mqttClient, topic)
    3.getSubscribers(topic)
  2. Create s very simple implementation based on hash map with name SimpleSubscriptionService

Different re-send messages policies depend on MQTT version

With MQTT 5, brokers and clients are not allowed to retransmit MQTT messages for healthy TCP connections. The brokers and clients must re-send unacknowledged packets when the TCP connection was closed, though. So the QoS 1 and 2 guarantees are as important as with MQTT 3.1.1.

In case you rely on retransmission packets in your use case (e.g. because your implementation does not acknowledge packets in certain cases), we suggest reconsidering this decision before upgrading to MQTT 5.

Update Subscription Service

From specs:
"When Clients make subscriptions with Topic Filters that include wildcards, it is possible for a Client’s subscriptions to overlap so that a published message might match multiple filters. In this case the Server MUST deliver the message to the Client respecting the maximum QoS of all the matching subscriptions [MQTT-3.3.4-2]. In addition, the Server MAY deliver further copies of the message, one for each additional matching subscription and respecting the subscription’s QoS in each case."

To implement this we need to do:

  1. Change the method from Array getSubscribers(topicName) to void forEach(subscriber)-> {})
  2. If we have wildcard subscriptions before to call the lambda, we need to find all repeated subscribers and to choose subscribers with higher QoS from them and to call the lambda only for uniq set of subscribers

Implement request limiters

Need to implement request limiters:

  1. publish per external client
  2. publish per internal client
  3. publish for all external limits
  4. publish for all internal limits

Additional difference in CONN packet between 3.1.1 and 5.0

For MQTT 3.1.1
If the Password Flag is set to 0, a password MUST NOT be present in the payload [MQTT-3.1.2-20].
If the Password Flag is set to 1, a password MUST be present in the payload [MQTT-3.1.2-21].
If the User Name Flag is set to 0, the Password Flag MUST be set to 0
For MQTT 5.0
The password flag is independent of the username flag.

Implement Simple Client Id Registry

This service should provide the next API:

  1. register/unregister client id
  2. validate client id
  3. check to exist of the client id
  4. generate a new uniq client id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.