Browse Source

Merge pull request #12539 from zhongwencool/rocketmq-channel-status

fix: Rocketmq channel status
zhongwencool 2 years ago
parent
commit
c08522bc1e

+ 1 - 1
apps/emqx_auth_http/src/emqx_auth_http.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_auth_http, [
     {description, "EMQX External HTTP API Authentication and Authorization"},
-    {vsn, "0.1.3"},
+    {vsn, "0.1.4"},
     {registered, []},
     {mod, {emqx_auth_http_app, []}},
     {applications, [

+ 2 - 2
apps/emqx_auth_http/src/emqx_authz_http.erl

@@ -157,7 +157,7 @@ parse_config(
         method => Method,
         base_url => BaseUrl,
         headers => Headers,
-        base_path_templete => emqx_authz_utils:parse_str(Path, allowed_vars()),
+        base_path_template => emqx_authz_utils:parse_str(Path, allowed_vars()),
         base_query_template => emqx_authz_utils:parse_deep(
             cow_qs:parse_qs(to_bin(Query)),
             allowed_vars()
@@ -197,7 +197,7 @@ generate_request(
     #{
         method := Method,
         headers := Headers,
-        base_path_templete := BasePathTemplate,
+        base_path_template := BasePathTemplate,
         base_query_template := BaseQueryTemplate,
         body_template := BodyTemplate
     }

+ 10 - 0
apps/emqx_bridge_mongodb/src/emqx_bridge_mongodb.erl

@@ -74,6 +74,11 @@ fields("creation_opts") ->
             importance => ?IMPORTANCE_HIDDEN,
             converter => fun(_, _) -> 1 end,
             desc => ?DESC("batch_size")
+        }},
+        {batch_time, #{
+            importance => ?IMPORTANCE_HIDDEN,
+            converter => fun(_, _) -> 0 end,
+            desc => ?DESC("batch_size")
         }}
     ]);
 fields(action) ->
@@ -102,6 +107,11 @@ fields(action_resource_opts) ->
             importance => ?IMPORTANCE_HIDDEN,
             converter => fun(_, _) -> 1 end,
             desc => ?DESC("batch_size")
+        }},
+        {batch_time, #{
+            importance => ?IMPORTANCE_HIDDEN,
+            converter => fun(_, _) -> 0 end,
+            desc => ?DESC("batch_size")
         }}
     ]);
 fields(resource_opts) ->

+ 7 - 4
apps/emqx_bridge_rocketmq/src/emqx_bridge_rocketmq_connector.erl

@@ -179,11 +179,14 @@ on_remove_channel(
     {ok, NewState}.
 
 on_get_channel_status(
-    _ResId,
-    _ChannelId,
-    _State
+    InstanceId,
+    ChannelId,
+    #{installed_channels := Channels} = State
 ) ->
-    ?status_connected.
+    case maps:find(ChannelId, Channels) of
+        {ok, _} -> on_get_status(InstanceId, State);
+        error -> ?status_disconnected
+    end.
 
 on_get_channels(ResId) ->
     emqx_bridge_v2:get_channels_for_connector(ResId).