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

MQTT Query Interface #461

Open
wants to merge 115 commits into
base: master
Choose a base branch
from
Open

MQTT Query Interface #461

wants to merge 115 commits into from

Conversation

NehaSelvan1512
Copy link

Summary

This MQTT Query Interface extension enables Polypheny to intercept MQTT (Message Queuing Telemetry Transport) data streams by connecting to an MQTT Broker. These MQTT messages can be optionally filtered and subsequently stored in the document data model.

Changes

  • MongoQL Find Operator also queries boolean values.
  • For querying documents, that are not yet saved, also LogicalDocumentsValues can be used.
  • New MongoQL "$$ROOT" key is internally handled like a common key but is used in the MQTT Interface as a special key to reference single values in the message payload that are not in the JSON format.
  • Settings HashMap for all Query Interfaces is now modifiable.

Features

List any new introduced features

  • The MQTT Interface can connect to a running broker with MQTT version 5.0.
  • It can subscribe to and unsubscribe from topics.
  • It can receive and publish MQTT messages.
  • StreamMessage is used for the internal representation of the MQTT messages.
  • To filter messages from a topic, a filter can be specified in the following format: :. The query has the same format as the filter in MongoQL.
  • If a filter was specified, only messages matching the filter conditions will be saved, otherwise, all messages from that topic will be saved.
  • MQTT messages are saved in the document data model and are therefore stored in one collection or in multiple collections separated by the topic.
  • The MQTT Interface includes a monitoring page where the list of subscribed topics, the recently received messages and information from the broker are displayed. Also, publishing MQTT messages can be triggered here.

Bug Fixes

All related Bug fixes

  • When changing from the option to store all messages in one collection to the option to store messages with different topics in separate collections, the collections for each topic are not created.
  • The catchAllEntityName entry field should not be null for a successful deployment, although it is be nullable according to the settings options.

Tests

Summarize the introduced test capabilities for your feature.

  • Filter feature.
  • Separation of the query and the topic from a filter.
  • Storing feature.
  • Change of settings values.
  • Extraction of information for the monitoring page.

Tests executed as a GitHub Action Workflow in a Docker container running a broker:

  • Subscribing to and unsubscribing from topics.
  • Procedure for receiving a message from the broker
  • Special handling for messages from topics that were subscribed to with a wildcard.
  • Creation of required namespace and collections for storing the messages

ToDo

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

vogti and others added 30 commits June 5, 2023 11:18
methods can't be triggered yet.
created table to display the subscribed topics.
also fixed bug in subscribe method.
accidently pushed them with the last commit
from eclipse paho to HiveMQ MQTT-Client
also removed the eclipse library
Method processMsg() and toString() implemented.
saveMsgInFile method not done yet.
Deleted unnecessary file which was created before.
works, but aspect with namespace comparison is still missing
sub and unsub of topics after starting plugin works.
"permanent" topics can't be unsubscribed permanently yet.
namespaces are now queried and created if a namespace of type Document is not existing.
All aspects (namespaces, collections, collection type, placement) are now considered.
Nothing tested yet... (therefore created main method).
Also separated creating namespace and collection.
added necessary instance variables for class StreamCapture.
created few constructors.
- saveContent implementation not finished yet.
- added Placements to createCollection
methods: getCollection, createNamespace, createNewCollection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants