greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

supports write in MQTT protocol

Open MichaelScofield opened this issue 2 years ago • 2 comments

What problem does the new feature solve?

MQTT protocol is very important in IOT industry, we should support it.

ref:

  • https://mqtt.org/

What does the feature do?

Insert metrics into our db in MQTT protocol.

Implementation challenges

  • One implementation option:

Use EMQX's "Data Bridges" feature to write data into GreptimeDB.

In general, we can simply create a webhook of it (see its "Quick Start" ), then EMQX will call the specified http endpoint. The http endpoint is exposed by GreptimeDB, and through which we ingest the data feed by EMQX.

EMQX uses "Rules" to extract fields from input data and assemble output data, we might need to design a request protocol, specify the required params.

Also, aside from a table for storing mqtt data, GreptimeDB might need a mqtt "status" table, to store the various "events" emitted by EMQX.

  • Another implementation option:

TBD

MichaelScofield avatar Nov 21 '22 08:11 MichaelScofield

I don't think we can impl the whole MQTT protocol in GreptimeDB, it's really complicated.

I think we can impl an ~~EMQX plugin~~ EMQ bridge to write data from EMQ into greptimedb.

https://docs.emqx.com/en/enterprise/v4.2/bridge/bridge.html

killme2008 avatar Nov 21 '22 08:11 killme2008

Typically we don't expose MQTT directly to IoT devices because that layer has its own authentication, data validation and device management business logic.

In most case we need to bridge our customer's internal kafka/pulsa/pravega queues to our db. These bridges can be implemented in our solution products.

sunng87 avatar Nov 23 '22 02:11 sunng87

Is this supported? @killme2008

waynexia avatar Jul 11 '23 02:07 waynexia

I am developing a data bridge for EMQX https://github.com/killme2008/emqx/pull/3 and i'll create a PR this week.

This issue can be closed, we don't support the MQTT protocol directly in GreptimeDB, but provide this data bridge.

killme2008 avatar Jul 11 '23 02:07 killme2008

only used in emqx enterprise version?

codering avatar Jan 12 '24 09:01 codering