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
This commit is contained in:
Kjell Winblad 2023-06-27 17:09:38 +02:00
parent 85a130f68b
commit 3d1712c00c
9 changed files with 21 additions and 10 deletions

View File

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

View File

@ -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]}
]}.

View File

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

View File

@ -1,7 +1,7 @@
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved. %% 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("typerefl/include/types.hrl").
-include_lib("hocon/include/hoconsc.hrl"). -include_lib("hocon/include/hoconsc.hrl").

View File

@ -2,7 +2,7 @@
% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved. % 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(nowarn_export_all).
-compile(export_all). -compile(export_all).

View File

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

View File

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

View File

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

View File

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