Code Monkey home page Code Monkey logo

mqtt's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.