emqx / emqx-elixir-plugin

An Example Plugin for EMQX in Elixir
https://emqx.io
23 stars 8 forks source link

Request: Add more detailed examples. #26

Open cocoaway opened 1 year ago

cocoaway commented 1 year ago

Hi,

Would it be possible to have an example of how to create a plugin which, connected to a topic, takes the message (payload), transforms it and publishes it on another topic?

Example :

topic test/hello/msg
msg {"val1" : 50, "val2": 30}
Function to app : sum(val1, val2)
publish on topic test/hello/result -> {"val1" : 50, "val2": 30, "sum": 80}

A thousand thanks.