oxigdal-mqtt
MQTT protocol support for OxiGDAL - IoT sensor data integration, pub/sub messaging, and geospatial time-series streaming.
Features
-
MQTT Protocol Support
- MQTT 3.1.1 and 5.0
- Async client with automatic reconnection
- QoS levels 0, 1, and 2
- Retained messages
- Last Will and Testament (LWT)
-
Publisher
- Simple and batch publishing
- Configurable QoS and retention
- Message persistence (optional)
- Concurrent publishing with backpressure
-
Subscriber
- Topic wildcards (
+and#) - Message routing
- Multiple handlers per topic
- Channel-based message delivery
- Topic wildcards (
-
IoT Integration
- Sensor data types (temperature, humidity, pressure, etc.)
- Geospatial messages with location data
- Time-series data with aggregation
- Device telemetry and status messages
-
Pure Rust
- No C/C++ dependencies (uses
rumqttc) - COOLJAPAN Policy compliant
- No unwrap() usage
- Comprehensive error handling
- No C/C++ dependencies (uses
Quick Start
Add this to your Cargo.toml:
[]
= "0.1"
Basic Publisher
use ;
use ;
use ;
use Arc;
async
Basic Subscriber
use ;
use ;
use ;
use Arc;
async
IoT Sensor Data
use ;
use ;
use ;
use ConnectionOptions;
use Arc;
async
Features
default: Includesstdandmqtt5std: Standard library supportmqtt3: MQTT 3.1.1 protocolmqtt5: MQTT 5.0 protocol (default)persistence: Message persistence with sledtls: TLS/SSL supportwebsocket: WebSocket transportcompression: Message compressiongeospatial: Geospatial message types with GeoJSON support
Architecture
The crate is organized into several modules:
client: MQTT client with connection management and auto-reconnectionpublisher: Message publishing with batching and persistencesubscriber: Message subscription with routing and handlersiot: IoT-specific types (sensors, geospatial, time-series)types: Core types (Message, QoS, TopicFilter, etc.)error: Comprehensive error types
Examples
See the examples/ directory for more examples:
basic_pubsub.rs: Basic publish-subscribe exampleiot_sensor.rs: IoT sensor data publishingpersistent_client.rs: Publisher with message persistence
Run examples with:
Testing
Run tests with:
Run benchmarks with:
License
Licensed under Apache License 2.0.
Authors
COOLJAPAN OU (Team Kitasan)