emqx/lib-ee/emqx_ee_schema_registry
Kjell Winblad 70ce781cc0 test: that one cannot register a schema with the magic SparkplugB name 2023-07-03 19:18:43 +02:00
..
etc feat: implement schema registry for 5.0 (avro) 2023-04-06 16:28:45 -03:00
include feat: add Sparkplug encode and decode functions to the rule engine 2023-06-30 10:06:56 +02:00
priv fix: problems found by @thalesmg in review 2023-07-03 12:21:55 +02:00
src fix: test issue (probably) caused by application start order 2023-07-03 18:12:55 +02:00
test test: that one cannot register a schema with the magic SparkplugB name 2023-07-03 19:18:43 +02:00
.gitignore feat: implement schema registry for 5.0 (avro) 2023-04-06 16:28:45 -03:00
README.md feat: implement schema registry for 5.0 (avro) 2023-04-11 14:50:45 -03:00
rebar.config fix: decouple emqx_rule_engine application from emqx_ee_schema_registry 2023-06-30 16:56:16 +02:00

README.md

EMQX Schema Registry

EMQX Schema Registry for managing various of schemas for decoding/encoding messages.

To use schema in rule engine, a schema name should be passed to the SQL functions that decode/encode data, like:

SELECT
     schema_decode('sensor_notify', payload) as payload
FROM
     "message.publish"
WHERE
     topic = 't/1'

Using schema registry with rule engine

                      +---------------------------+
                     |                           |
 Events/Msgs         |                           |   Events/Msgs
 -------------------->           EMQX            |------------------>
                     |                           |
                     |                           |
                     +-------------|-------------+
                                   |
                             HOOK  |
                                   |
                     +-------------v-------------+           +----------+
                     |                           |   Data    |          |
                     |        Rule Engine        ------------- Backends |
                     |                           |           |          |
                     +------|-------------|------+           +----------+
                            |^            |^
                      Decode||            ||Encode
                            ||            ||
                     +------v|------------v|-----+
                     |                           |
                     |      Schema Registry      |
                     |                           |
                     +---------------------------+

Architecture

                              |              |
                       Decode |    [APIs]    | Encode
                              |              |
                              |              |           [Registry]
                       +------v--------------v------+
    REGISTER SCHEMA    |                            |
       INSTANCE        |                            |    +--------+
    ------------------->                            |    |        |
[Management APIs]      |       Schema Registry      ------ Schema |
                       |                            |    |        |
                       |                            |    +--------+
                       |                            |
                       +----------------------------+
                            /        |        \
                       +---/---+ +---|----+ +---\---+
                       |       | |        | |       |
      [Decoders]       | Avro  | |ProtoBuf| |Others |
                       |       | |        | |       |
                       +-------+ +--------+ +-------+

  • Register schema instance: adds a new instance of a schema of a certain type. For example, when the user may have several Avro or Protobuf schemas that they wish to use with different data flows.