General Plugin Concepts
Basics
The YedMQ plugin is written in Rust and is dynamically loaded by YedMQ during the startup phase through a dynamic link library.
Plugin Structure
Each YedMQ plugin consists of a dynamic link library (.so file) and a plugin description file based on the TOML format (plugin.toml).
The folder structure is as follows:
|- example-plugin/ 1
| |- libexample-plugin.so 2
| |- plugin.toml 3
1: The plugin folder.
2: The dynamic link library file for the plugin.
3: The plugin description configuration file in TOML format.
Plugin Metadata
YedMQ uses the plugin.toml file to store the metadata and execution priority of the plugin.
The execution priority of the plugins can be defined by the user, which determines the order in which YedMQ executes the plugins. If multiple plugins of the same type exist, the one with the highest priority will be executed first.
Example of plugin.toml:
[plugin]
name = "demo_plugin"
author = "yedmq"
description = "Just a demo plugin"
version = "1.0.0"
entry = "./libexample_plugin.so"
priority = 1000
name: The name of the plugin.author: The author of the plugin.description: A brief description of the plugin.version: The version of the plugin.entry: The entry point of the plugin, i.e., the location of the dynamic link library file.priority: The execution priority of the plugin.