Polypheny-DB
Polypheny-DB copied to clipboard
MQTT Query Interface
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)