From 38d3a1d7d0254b3bc90650def178b22600438bbe Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 22 Nov 2023 09:25:28 -0300 Subject: [PATCH] feat(actions): allow multiple action info modules per application --- apps/emqx_bridge/src/emqx_action_info.erl | 6 +++--- .../src/emqx_bridge_azure_event_hub.app.src | 2 +- apps/emqx_bridge_kafka/src/emqx_bridge_kafka.app.src | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/emqx_bridge/src/emqx_action_info.erl b/apps/emqx_bridge/src/emqx_action_info.erl index b236558e1..7c246a797 100644 --- a/apps/emqx_bridge/src/emqx_action_info.erl +++ b/apps/emqx_bridge/src/emqx_action_info.erl @@ -211,9 +211,9 @@ action_info_modules() -> lists:usort(lists:flatten(ActionInfoModules) ++ hard_coded_action_info_modules()). action_info_modules(App) -> - case application:get_env(App, emqx_action_info_module) of - {ok, Module} -> - [Module]; + case application:get_env(App, emqx_action_info_modules) of + {ok, Modules} -> + Modules; _ -> [] end. diff --git a/apps/emqx_bridge_azure_event_hub/src/emqx_bridge_azure_event_hub.app.src b/apps/emqx_bridge_azure_event_hub/src/emqx_bridge_azure_event_hub.app.src index 40ea79334..f1c097d29 100644 --- a/apps/emqx_bridge_azure_event_hub/src/emqx_bridge_azure_event_hub.app.src +++ b/apps/emqx_bridge_azure_event_hub/src/emqx_bridge_azure_event_hub.app.src @@ -9,7 +9,7 @@ telemetry, wolff ]}, - {env, []}, + {env, [{emqx_action_info_modules, [emqx_bridge_azure_event_hub_action_info]}]}, {modules, []}, {links, []} ]}. diff --git a/apps/emqx_bridge_kafka/src/emqx_bridge_kafka.app.src b/apps/emqx_bridge_kafka/src/emqx_bridge_kafka.app.src index 00b9d8968..da8df2ddc 100644 --- a/apps/emqx_bridge_kafka/src/emqx_bridge_kafka.app.src +++ b/apps/emqx_bridge_kafka/src/emqx_bridge_kafka.app.src @@ -12,7 +12,7 @@ brod, brod_gssapi ]}, - {env, [{emqx_action_info_module, emqx_bridge_kafka_action_info}]}, + {env, [{emqx_action_info_modules, [emqx_bridge_kafka_action_info]}]}, {modules, []}, {links, []}