Remove redundant topic field from MQTT source messages
I've searched existing issues and didn't find similar requests, but please let me know if this has already been discussed.
When using dynamic topics with MQTT sources, the topic field is included in the payload. This appears redundant since the topic is already available in the message context.
I propose automatically removing the topic field from the payload before forwarding the message, as this information is already available and will reduce payload size.
This optimization might also apply to other sources that use dynamic topics(?)
In the sink, you can specify the fields in the final output to get rid of the redundant fields. Check the doc https://ekuiper.org/docs/en/latest/guide/sinks/overview.html#common-properties
{
"actions": [
{
"mqtt":{
"topic": xxx,
"fields":["field1", "field2"]
}
}
]
}
That work thanks, sorry I missed that part from the documentation