Skip to content

Commit

Permalink
Merge pull request #12359 from thalesmg/fix-connector-app-deps-r55-20…
Browse files Browse the repository at this point in the history
…240119

fix(machine_boot): inject connector/bridge apps as dependencies to `emqx_connector` app
  • Loading branch information
thalesmg committed Jan 24, 2024
2 parents 947a08d + b763e39 commit a19cf25
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions apps/emqx_bridge_es/src/emqx_bridge_es.app.src
Expand Up @@ -10,8 +10,7 @@
{applications, [
kernel,
stdlib,
emqx_resource,
emqx_connector
emqx_resource
]},
{env, []},
{licenses, ["Business Source License 1.1"]},
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_bridge_http/src/emqx_bridge_http.app.src
Expand Up @@ -2,7 +2,7 @@
{description, "EMQX HTTP Bridge and Connector Application"},
{vsn, "0.2.2"},
{registered, []},
{applications, [kernel, stdlib, emqx_connector, emqx_resource, ehttpc]},
{applications, [kernel, stdlib, emqx_resource, ehttpc]},
{env, [{emqx_action_info_modules, [emqx_bridge_http_action_info]}]},
{modules, []},
{links, []}
Expand Down
4 changes: 1 addition & 3 deletions apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src
Expand Up @@ -10,9 +10,7 @@
{applications, [
kernel,
stdlib,
emqx_resource,
%% for module emqx_connector_http
emqx_connector
emqx_resource
]},
{env, []},
{licenses, ["Business Source License 1.1"]},
Expand Down
1 change: 0 additions & 1 deletion apps/emqx_bridge_mongodb/src/emqx_bridge_mongodb.app.src
Expand Up @@ -5,7 +5,6 @@
{applications, [
kernel,
stdlib,
emqx_connector,
emqx_resource,
emqx_mongodb
]},
Expand Down
1 change: 0 additions & 1 deletion apps/emqx_bridge_mysql/src/emqx_bridge_mysql.app.src
Expand Up @@ -5,7 +5,6 @@
{applications, [
kernel,
stdlib,
emqx_connector,
emqx_resource,
emqx_mysql
]},
Expand Down
1 change: 0 additions & 1 deletion apps/emqx_bridge_redis/src/emqx_bridge_redis.app.src
Expand Up @@ -5,7 +5,6 @@
{applications, [
kernel,
stdlib,
emqx_connector,
emqx_resource,
emqx_redis
]},
Expand Down
7 changes: 7 additions & 0 deletions apps/emqx_machine/src/emqx_machine_boot.erl
Expand Up @@ -178,6 +178,11 @@ app_deps(App, RebootApps) ->
%% `emqx_bridge' is special in that it needs all the bridges apps to
%% be started before it, so that, when it loads the bridges from
%% configuration, the bridge app and its dependencies need to be up.
%%
%% `emqx_connector' also needs to start all connector dependencies for the same reason.
%% Since standalone apps like `emqx_mongodb' are already dependencies of `emqx_bridge_*'
%% apps, we may apply the same tactic for `emqx_connector' and inject individual bridges
%% as its dependencies.
inject_bridge_deps(RebootAppDeps) ->
BridgeApps = [
App
Expand All @@ -188,6 +193,8 @@ inject_bridge_deps(RebootAppDeps) ->
fun
({emqx_bridge, Deps0}) when is_list(Deps0) ->
{emqx_bridge, Deps0 ++ BridgeApps};
({emqx_connector, Deps0}) when is_list(Deps0) ->
{emqx_connector, Deps0 ++ BridgeApps};
(App) ->
App
end,
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_management/test/emqx_mgmt_api_configs_SUITE.erl
Expand Up @@ -392,7 +392,7 @@ t_create_webhook_v1_bridges_api({'init', Config}) ->
lists:foreach(
fun(App) ->
_ = application:stop(App),
{ok, [App]} = application:ensure_all_started(App)
{ok, _} = application:ensure_all_started(App)
end,
[emqx_connector, emqx_bridge]
),
Expand Down
3 changes: 1 addition & 2 deletions apps/emqx_mongodb/src/emqx_mongodb.app.src
@@ -1,12 +1,11 @@
{application, emqx_mongodb, [
{description, "EMQX MongoDB Connector"},
{vsn, "0.1.4"},
{vsn, "0.1.5"},
{registered, []},
{applications, [
kernel,
stdlib,
mongodb,
emqx_connector,
emqx_resource
]},
{env, []},
Expand Down
3 changes: 1 addition & 2 deletions apps/emqx_mysql/src/emqx_mysql.app.src
@@ -1,12 +1,11 @@
{application, emqx_mysql, [
{description, "EMQX MySQL Database Connector"},
{vsn, "0.1.6"},
{vsn, "0.1.7"},
{registered, []},
{applications, [
kernel,
stdlib,
mysql,
emqx_connector,
emqx_resource
]},
{env, []},
Expand Down
3 changes: 1 addition & 2 deletions apps/emqx_postgresql/src/emqx_postgresql.app.src
@@ -1,12 +1,11 @@
{application, emqx_postgresql, [
{description, "EMQX PostgreSQL Database Connector"},
{vsn, "0.1.1"},
{vsn, "0.1.2"},
{registered, []},
{applications, [
kernel,
stdlib,
epgsql,
emqx_connector,
emqx_resource
]},
{env, []},
Expand Down
3 changes: 1 addition & 2 deletions apps/emqx_redis/src/emqx_redis.app.src
@@ -1,13 +1,12 @@
{application, emqx_redis, [
{description, "EMQX Redis Database Connector"},
{vsn, "0.1.4"},
{vsn, "0.1.5"},
{registered, []},
{applications, [
kernel,
stdlib,
eredis,
eredis_cluster,
emqx_connector,
emqx_resource
]},
{env, []},
Expand Down
1 change: 1 addition & 0 deletions changes/ce/fix-12359.en.md
@@ -0,0 +1 @@
Fixed an issue that could lead to error messages when restarting a node configured with some types of data bridges. Said bridges could also start in a failed state, requiring manual restart.

0 comments on commit a19cf25

Please sign in to comment.