0.0
No release in over 3 years
Pure Ruby implementation of the MQTT 3.1.1 and 5.0 packet codec: encode, decode, VBI, properties, reason codes. Protocol::MQTT::Connection wraps an IO::Stream to read and write packets. No I/O beyond IO::Stream.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 0.11
 Project Readme

protocol-mqtt — MQTT 3.1.1 + 5.0 wire codec

CI Gem Version License: ISC Ruby

Pure-Ruby MQTT codec. Handles MQTT 3.1.1 (OASIS 2014) and MQTT 5.0 (OASIS 2019) with a single unified packet family, version detected after CONNECT.

This is the wire layer. For a full async MQTT client and broker built on top of it, see zzq.

Status: pre-alpha. See the design plan for scope.

What's inside

  • Protocol::MQTT::VBI — variable byte integer encode/decode (1–4 bytes).
  • Protocol::MQTT::Codec — primitives: u8/u16/u32, UTF-8 string, binary data, string pair.
  • Protocol::MQTT::Property — v5 property identifier table, encode/decode.
  • Protocol::MQTT::ReasonCodes — full v5 reason-code taxonomy + v3.1.1 return-code bridge.
  • Protocol::MQTT::Packet — base class + one subclass per packet type (CONNECT, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK, PINGREQ, PINGRESP, DISCONNECT, AUTH).
  • Protocol::MQTT::Connection — wraps an IO::Stream; #read_packet and #write_packet. Version-aware after first CONNECT.

License

ISC. See LICENSE.