Skip to content

KxSystems/mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4a828ab Β· Jan 29, 2025

History

97 Commits
Jan 29, 2025
Jan 29, 2025
Jan 20, 2025
Jan 6, 2021
Mar 14, 2023
Jan 29, 2025
Feb 24, 2023
Jan 15, 2025
Nov 15, 2022
Apr 29, 2020
Mar 15, 2020
May 2, 2024
May 11, 2020
May 26, 2020
Feb 24, 2023
Jan 29, 2025

Repository files navigation

MQTT mqtt - MQTT for kdb+

GitHub release (latest by date) Travis (.org) branch

This interface lets you communicate with an MQTT broker from a kdb+ session. The interface follows closely the PAHO MQTT C API. Exposed functionality includes

  • connect to a MQTT broker
  • subscribe to topics
  • publish to a broker

This is part of the Fusion for kdb+ interface collection.

New to kdb+ ?

Kdb+ is the world’s fastest timeseries database, optimized for ingesting, analyzing and storing massive amounts of structured data. To get started with kdb+, please visit https://code.kx.com/q/learn/ for downloads and developer information. For general information, visit https://kx.com/

New to MQTT ?

Message Queueing Telemetry Transport (MQTT) is a machine-to-machine/IOT connectivity protocol. It is designed to provide a lightweight publish/subscribe messaging protocol.

MQTT is used commonly for constrained devices with low-bandwidth, high-latency or unreliable networks.

Use cases

This messaging protocol is used extensively where a small software footprint is required, e.g.

  • communication with edge devices/sensors
  • home automation
  • mobile applications

🌐 MQTT: Real-world applications

API Documentation

πŸ‘‰ API reference

Installation Documentation

πŸ‘‰ Install guide

Debugging/Tracing

πŸ‘‰ The underlying Paho MQTT library provides the ability to log diagnostic information to standard out or log files via an environment variable as detailed here

Building From Source

πŸ‘‰ Building guide

Quick start

Requirements

To run the examples you will need a MQTT broker e.g.

Start Mosquitto

Start Mosquitto on default port localhost:1883.

sudo systemctl start mosquitto

Launch consumer

We assume you are in the source directory of the MQTT-kdb+ interface.

mqtt]$ cd q
q]$ q ../examples/consumer.q 

Launch producer

In the same directory as the one launching a consumer, run:

q]$ q ../examples/producer.q

Then pubish a message by a timer, say every second:

q)\t 1000

Going back to the console of consumer, now you can see received messages in .mqtt.tab:

q).mqtt.tab
topic  msg_sent                      msg_recv                      received_m..
-----------------------------------------------------------------------------..
topic1 2021.01.06D13:24:46.267356000 2021.01.06D13:24:46.267718000 topic1_3  ..
topic2 2021.01.06D13:24:46.267450000 2021.01.06D13:24:46.368412000 topic2_3  ..
topic1 2021.01.06D13:24:47.267366000 2021.01.06D13:24:47.268676000 topic1_4  ..
topic2 2021.01.06D13:24:47.267624000 2021.01.06D13:24:47.372268000 topic2_4  ..
topic1 2021.01.06D13:24:48.276623000 2021.01.06D13:24:48.277677000 topic1_5  ..
topic2 2021.01.06D13:24:48.276801000 2021.01.06D13:24:48.377926000 topic2_5  ..
topic1 2021.01.06D13:24:49.267324000 2021.01.06D13:24:49.268228000 topic1_6  ..
topic2 2021.01.06D13:24:49.267482000 2021.01.06D13:24:49.368805000 topic2_6  ..
topic1 2021.01.06D13:24:50.267684000 2021.01.06D13:24:50.268125000 topic1_7  ..
topic2 2021.01.06D13:24:50.267804000 2021.01.06D13:24:50.368889000 topic2_7  ..

Status

The interface is currently available under an Apache 2.0 license and is supported on a best-efforts basis by the KX Fusion team. The interface is currently in active development, with additional functionality released on an ongoing basis.

πŸ‘‰ Issues and feature requests

πŸ‘‰ Guide to contributing

Packages

No packages published

Contributors 7