Merge pull request #12270 from lafirest/fix/syskeeper
fix(sysk): improve the seakeeper schema
This commit is contained in:
commit
add1368f5d
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_bridge_syskeeper, [
|
||||
{description, "EMQX Enterprise Data bridge for Syskeeper"},
|
||||
{vsn, "0.1.0"},
|
||||
{vsn, "0.1.1"},
|
||||
{registered, []},
|
||||
{applications, [
|
||||
kernel,
|
||||
|
|
|
@ -61,7 +61,6 @@ values(put) ->
|
|||
connector => <<"syskeeper_forwarder">>,
|
||||
parameters => #{
|
||||
target_topic => <<"${topic}">>,
|
||||
target_qos => <<"-1">>,
|
||||
template => <<"${payload}">>
|
||||
},
|
||||
resource_opts => #{
|
||||
|
@ -117,8 +116,8 @@ fields("parameters") ->
|
|||
)},
|
||||
{target_qos,
|
||||
mk(
|
||||
range(-1, 2),
|
||||
#{desc => ?DESC("target_qos"), default => -1}
|
||||
range(1, 2),
|
||||
#{desc => ?DESC("target_qos"), required => false}
|
||||
)},
|
||||
{template,
|
||||
mk(
|
||||
|
|
|
@ -219,9 +219,8 @@ on_add_channel(
|
|||
#{
|
||||
parameters := #{
|
||||
target_topic := TargetTopic,
|
||||
target_qos := TargetQoS,
|
||||
template := Template
|
||||
}
|
||||
} = Parameters
|
||||
}
|
||||
) ->
|
||||
case maps:is_key(ChannelId, Channels) of
|
||||
|
@ -229,7 +228,7 @@ on_add_channel(
|
|||
{error, already_exists};
|
||||
_ ->
|
||||
Channel = #{
|
||||
target_qos => TargetQoS,
|
||||
target_qos => maps:get(target_qos, Parameters, undefined),
|
||||
target_topic => emqx_placeholder:preproc_tmpl(TargetTopic),
|
||||
template => emqx_placeholder:preproc_tmpl(Template)
|
||||
},
|
||||
|
@ -335,7 +334,7 @@ render_message(#{id := Id, qos := QoS, clientid := From} = Data, #{
|
|||
id => emqx_guid:from_hexstr(Id),
|
||||
qos :=
|
||||
case TargetQoS of
|
||||
-1 ->
|
||||
undefined ->
|
||||
QoS;
|
||||
_ ->
|
||||
TargetQoS
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%%--------------------------------------------------------------------
|
||||
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%%
|
||||
%% @doc EMQ X Bridge Sysk Frame
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%%--------------------------------------------------------------------
|
||||
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%%
|
||||
%% @doc EMQ X Bridge Sysk Frame version 1
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%%--------------------------------------------------------------------
|
||||
%% Copyright (c) 2022 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||
%%--------------------------------------------------------------------
|
||||
-module(emqx_bridge_syskeeper_proxy).
|
||||
|
||||
|
|
|
@ -110,7 +110,6 @@ syskeeper_config(Config) ->
|
|||
" connector = ~ts\n"
|
||||
" parameters = {\n"
|
||||
" target_topic = \"${topic}\"\n"
|
||||
" target_qos = -1\n"
|
||||
" template = \"${payload}\"\n"
|
||||
" },\n"
|
||||
" resource_opts = {\n"
|
||||
|
|
|
@ -37,7 +37,7 @@ target_topic.label:
|
|||
"""Target Topic"""
|
||||
|
||||
target_qos.desc:
|
||||
"""The QoS for the forwarded message, -1 is for the original topic"""
|
||||
"""The QoS for the forwarded message. To preserve the original QoS of the forwarded message, the value can be omitted."""
|
||||
|
||||
target_qos.label:
|
||||
"""Target QoS"""
|
||||
|
|
Loading…
Reference in New Issue