Merge pull request #12539 from zhongwencool/rocketmq-channel-status
fix: Rocketmq channel status
This commit is contained in:
commit
c08522bc1e
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_auth_http, [
|
{application, emqx_auth_http, [
|
||||||
{description, "EMQX External HTTP API Authentication and Authorization"},
|
{description, "EMQX External HTTP API Authentication and Authorization"},
|
||||||
{vsn, "0.1.3"},
|
{vsn, "0.1.4"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_auth_http_app, []}},
|
{mod, {emqx_auth_http_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -157,7 +157,7 @@ parse_config(
|
||||||
method => Method,
|
method => Method,
|
||||||
base_url => BaseUrl,
|
base_url => BaseUrl,
|
||||||
headers => Headers,
|
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(
|
base_query_template => emqx_authz_utils:parse_deep(
|
||||||
cow_qs:parse_qs(to_bin(Query)),
|
cow_qs:parse_qs(to_bin(Query)),
|
||||||
allowed_vars()
|
allowed_vars()
|
||||||
|
@ -197,7 +197,7 @@ generate_request(
|
||||||
#{
|
#{
|
||||||
method := Method,
|
method := Method,
|
||||||
headers := Headers,
|
headers := Headers,
|
||||||
base_path_templete := BasePathTemplate,
|
base_path_template := BasePathTemplate,
|
||||||
base_query_template := BaseQueryTemplate,
|
base_query_template := BaseQueryTemplate,
|
||||||
body_template := BodyTemplate
|
body_template := BodyTemplate
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,11 @@ fields("creation_opts") ->
|
||||||
importance => ?IMPORTANCE_HIDDEN,
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
converter => fun(_, _) -> 1 end,
|
converter => fun(_, _) -> 1 end,
|
||||||
desc => ?DESC("batch_size")
|
desc => ?DESC("batch_size")
|
||||||
|
}},
|
||||||
|
{batch_time, #{
|
||||||
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
|
converter => fun(_, _) -> 0 end,
|
||||||
|
desc => ?DESC("batch_size")
|
||||||
}}
|
}}
|
||||||
]);
|
]);
|
||||||
fields(action) ->
|
fields(action) ->
|
||||||
|
@ -102,6 +107,11 @@ fields(action_resource_opts) ->
|
||||||
importance => ?IMPORTANCE_HIDDEN,
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
converter => fun(_, _) -> 1 end,
|
converter => fun(_, _) -> 1 end,
|
||||||
desc => ?DESC("batch_size")
|
desc => ?DESC("batch_size")
|
||||||
|
}},
|
||||||
|
{batch_time, #{
|
||||||
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
|
converter => fun(_, _) -> 0 end,
|
||||||
|
desc => ?DESC("batch_size")
|
||||||
}}
|
}}
|
||||||
]);
|
]);
|
||||||
fields(resource_opts) ->
|
fields(resource_opts) ->
|
||||||
|
|
|
@ -179,11 +179,14 @@ on_remove_channel(
|
||||||
{ok, NewState}.
|
{ok, NewState}.
|
||||||
|
|
||||||
on_get_channel_status(
|
on_get_channel_status(
|
||||||
_ResId,
|
InstanceId,
|
||||||
_ChannelId,
|
ChannelId,
|
||||||
_State
|
#{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) ->
|
on_get_channels(ResId) ->
|
||||||
emqx_bridge_v2:get_channels_for_connector(ResId).
|
emqx_bridge_v2:get_channels_for_connector(ResId).
|
||||||
|
|
Loading…
Reference in New Issue