Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish the structure/schema of an incoming messages on MQTT #5032

Open
Tracked by #4788
joepavitt opened this issue Jan 17, 2025 · 7 comments
Open
Tracked by #4788

Establish the structure/schema of an incoming messages on MQTT #5032

joepavitt opened this issue Jan 17, 2025 · 7 comments
Assignees
Labels
area:api Work on the platform API headline Something to highlight in the release size:XL - 8 Sizing estimation point
Milestone

Comments

@joepavitt
Copy link
Contributor

joepavitt commented Jan 17, 2025

Given our traffic monitoring for the MQTT brokers, establish, and record, the payload structure/schema seen on each topic.

This would extend the work in #4919 where Nick established a foundation Async API schema for the topic hierarchy.

@joepavitt joepavitt added the area:api Work on the platform API label Jan 17, 2025
@joepavitt joepavitt moved this to Scheduled in ☁️ Product Planning Jan 17, 2025
@joepavitt joepavitt moved this to Todo in 🛠 Development Jan 17, 2025
@joepavitt joepavitt added the size:XL - 8 Sizing estimation point label Jan 17, 2025
@joepavitt joepavitt added this to the 2.14 milestone Jan 17, 2025
@joepavitt joepavitt added the headline Something to highlight in the release label Jan 17, 2025
@joepavitt joepavitt moved this from Todo to Up Next in 🛠 Development Jan 24, 2025
@hardillb
Copy link
Contributor

hardillb commented Feb 4, 2025

I've added some basic tests to the mqtt-schema-agent to test for the following:

  • Strings
    • XML
    • JSON (and then fed to the schema generator that @knolleary provided in the mqtt-schema-agent project)
  • Anything else

At the moment this is pushed to the topic API, but not stored yet. Need to work out what columns we need to add to the MQTTTopicSchema table

@joepavitt
Copy link
Contributor Author

Just to emphasise something I mentioned yesterday re: workflow that may impact DB columns, ideally we have a review process in place (as requested by customers). We propose that we think a given structure is relevant, e.g. string, json, etc. and then the user confirms it.

once confirmed it'd show as part of the AsyncAPI docs and the view in the topic hierarchy.

Designs can be found here: #4963

@hardillb
Copy link
Contributor

hardillb commented Feb 5, 2025

I'm thinking we need 2 columns

  • inferred payload schema
  • user payload schema

The first carries the value from the agent, the UI lets the user either "accept" this (copy it to the user payload column) or provide their own.

This way users can always override the generated value?

@knolleary
Copy link
Member

We already have the metadata column as a JSON blob. That should be treated as the official record of any meta data against the topic that the user has entered/confirmed etc. That can cover description, payload etc.

We should add a second column for the inferred metadata.

It does feel like this can get messy quite quickly after the user has 'confirmed' a payload schema - and we continue to detect and infer things under the covers. Not sure how we'd highlight to the user there's a difference. Lets take this one step at a time.

@knolleary knolleary moved this from Up Next to In Progress in 🛠 Development Feb 7, 2025
@hardillb hardillb moved this from In Progress to Review in 🛠 Development Feb 7, 2025
@knolleary
Copy link
Member

Have raised FlowFuse/mqtt-schema-agent#12 to improve some of the edge case handling around non-string payloads.

@joepavitt
Copy link
Contributor Author

@knolleary this is good to close now, right?

@joepavitt
Copy link
Contributor Author

I believe it's closed by FlowFuse/mqtt-schema-agent#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Work on the platform API headline Something to highlight in the release size:XL - 8 Sizing estimation point
Projects
Status: Scheduled
Status: Review
Development

No branches or pull requests

3 participants