feat: add stop after render and after render trace to mongodb action

This commit is contained in:
Kjell Winblad 2024-04-24 13:54:52 +02:00
parent e2b35ea242
commit beedc72be4
1 changed files with 6 additions and 1 deletions

View File

@ -66,10 +66,15 @@ on_query(InstanceId, {Channel, Message0}, #{channels := Channels, connector_stat
payload_template := PayloadTemplate,
collection_template := CollectionTemplate
} = ChannelState0 = maps:get(Channel, Channels),
Collection = emqx_placeholder:proc_tmpl(CollectionTemplate, Message0),
ChannelState = ChannelState0#{
collection => emqx_placeholder:proc_tmpl(CollectionTemplate, Message0)
collection => Collection
},
Message = render_message(PayloadTemplate, Message0),
emqx_trace:rendered_action_template(Channel, #{
collection => Collection,
data => Message
}),
Res = emqx_mongodb:on_query(
InstanceId,
{Channel, Message},