Code Monkey home page Code Monkey logo

Comments (2)

jbrzozoski avatar jbrzozoski commented on July 22, 2024

To the best of my understanding, message sequence number resets to 0 each time you need to publish NBIRTH and goes up by one for all other messages. The bdSeq (which is optional) is supposed to go up by one each time a client connects to a broker, meaning if you publish multiple NBIRTH messages during the same session that they will all have the same bdSeq. Ideally, a client would retain its bdSeq number eternally and increment by one each new TCP session. The goal of the bdSeq is to allow easier tracking of lost connections, and matching NDEATH messages to NBIRTH, but a client can only setup the NDEATH once at the beginning of a session in the WILL of the CONNECT.

from sparkplug.

ckienle avatar ckienle commented on July 22, 2024

@jbrzozoski is correct
The "seq" number is used for sequencing all messages published by a Sparkplug client application and resets to 0 upon a new NBIRTH message.

The "bdSeq" number is used to match NDEATH messages with their corresponding NBIRTH message. They are only incremented when a new session is established and a new NBIRTH is published. One reason for this is because it is possible (in some client/server implementations) for an NDEATH (published as an LWT by the MQTT server) of a disconnected client to be delivered after the client has already reconnected and published a new NBIRTH. The receiving application should compare the "bdSeq" number of the NDEATH with the "bdSeq" number of the last NBIRTH that was received to see if it represents the "death" of the current session, or if it was for a past session.

Also, the project has been moved. Please post future questions and discussion here https://github.com/eclipse/tahu

from sparkplug.

Related Issues (15)

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.