فهرست منبع

refactor: MySQL bridge to its own application

This commit refactor the MySQL bridge to its own application.

Fixes:
https://emqx.atlassian.net/browse/EMQX-9533
Kjell Winblad 2 سال پیش
والد
کامیت
3d1712c00c

+ 2 - 0
apps/emqx_bridge_mysql/docker-ct

@@ -0,0 +1,2 @@
+toxiproxy
+mysql

+ 11 - 0
apps/emqx_bridge_mysql/rebar.config

@@ -0,0 +1,11 @@
+%% -*- mode: erlang; -*-
+{erl_opts, [debug_info]}.
+{deps, [ {emqx_connector, {path, "../../apps/emqx_connector"}}
+       , {emqx_resource, {path, "../../apps/emqx_resource"}}
+       , {emqx_bridge, {path, "../../apps/emqx_bridge"}}
+       , {emqx_mysql, {path, "../../apps/emqx_mysql"}}
+       ]}.
+
+{shell, [
+    {apps, [emqx_bridge_mysql]}
+]}.

+ 2 - 2
apps/emqx_bridge_mysql/src/emqx_bridge_mysql.app.src

@@ -1,8 +1,8 @@
 {application, emqx_bridge_mysql, [
     {description, "EMQX Enterprise MySQL Bridge"},
-    {vsn, "0.1.0"},
+    {vsn, "0.1.1"},
     {registered, []},
-    {applications, [kernel, stdlib]},
+    {applications, [kernel, stdlib, emqx_connector, emqx_resource, emqx_bridge, emqx_mysql]},
     {env, []},
     {modules, []},
     {links, []}

+ 1 - 1
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_mysql.erl

@@ -1,7 +1,7 @@
 %%--------------------------------------------------------------------
 %% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
--module(emqx_ee_bridge_mysql).
+-module(emqx_bridge_mysql).
 
 -include_lib("typerefl/include/types.hrl").
 -include_lib("hocon/include/hoconsc.hrl").

+ 1 - 1
lib-ee/emqx_ee_bridge/test/emqx_ee_bridge_mysql_SUITE.erl

@@ -2,7 +2,7 @@
 % Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
 %%--------------------------------------------------------------------
 
--module(emqx_ee_bridge_mysql_SUITE).
+-module(emqx_bridge_mysql_SUITE).
 
 -compile(nowarn_export_all).
 -compile(export_all).

+ 0 - 1
lib-ee/emqx_ee_bridge/docker-ct

@@ -1,2 +1 @@
 toxiproxy
-mysql

+ 0 - 1
lib-ee/emqx_ee_bridge/rebar.config

@@ -3,7 +3,6 @@
 {deps, [ {emqx_connector, {path, "../../apps/emqx_connector"}}
        , {emqx_resource, {path, "../../apps/emqx_resource"}}
        , {emqx_bridge, {path, "../../apps/emqx_bridge"}}
-       , {emqx_bridge, {path, "../../apps/emqx_mysql"}}
        , {emqx_utils, {path, "../emqx_utils"}}
        ]}.
 

+ 3 - 3
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge.erl

@@ -25,7 +25,7 @@ api_schemas(Method) ->
         %% to hocon; keeping this as just `kafka' for backwards compatibility.
         api_ref(emqx_bridge_kafka, <<"kafka">>, Method ++ "_producer"),
         api_ref(emqx_bridge_cassandra, <<"cassandra">>, Method),
-        api_ref(emqx_ee_bridge_mysql, <<"mysql">>, Method),
+        api_ref(emqx_bridge_mysql, <<"mysql">>, Method),
         api_ref(emqx_bridge_pgsql, <<"pgsql">>, Method),
         api_ref(emqx_bridge_mongodb, <<"mongodb_rs">>, Method ++ "_rs"),
         api_ref(emqx_bridge_mongodb, <<"mongodb_sharded">>, Method ++ "_sharded"),
@@ -58,7 +58,7 @@ schema_modules() ->
         emqx_bridge_gcp_pubsub,
         emqx_bridge_influxdb,
         emqx_bridge_mongodb,
-        emqx_ee_bridge_mysql,
+        emqx_bridge_mysql,
         emqx_bridge_redis,
         emqx_bridge_pgsql,
         emqx_bridge_timescale,
@@ -131,7 +131,7 @@ fields(bridges) ->
             )},
         {mysql,
             mk(
-                hoconsc:map(name, ref(emqx_ee_bridge_mysql, "config")),
+                hoconsc:map(name, ref(emqx_bridge_mysql, "config")),
                 #{
                     desc => <<"MySQL Bridge Config">>,
                     required => false

+ 1 - 1
rel/i18n/emqx_ee_bridge_mysql.hocon

@@ -1,4 +1,4 @@
-emqx_ee_bridge_mysql {
+emqx_bridge_mysql {
 
 config_enable.desc:
 """Enable or disable this bridge"""