Emqx: How to persist MQTT messages

Created on 5 Mar 2016  路  5Comments  路  Source: emqx/emqx

have integrated the broker with Kafka and Cassandra?

question

Most helpful comment

@andywang2014 What do you mean by persist? You want to persis certain topic's message to database like Cassandra? I think you have 2 option. First is to write yourself a plugin and subscribe certain topics and then persist them into db. The 2nd option is to write yourself a small application (not necessary in Erlang) that subscribe to any topics you like and persist them into db. Personally, I prefer the 2nd option because the Unix philosophy "Do One Thing and Do It Well". The message broker itself shall not take that responsibility itself. And besides, if you are in a cluster situation you will have to persist the message many times unless you have a smart design on you plugin. (starting the plugin only in a single node is risky)

All 5 comments

Any information about this question?
Have looked at kafka plugin, seems like empty template for me.

@andywang2014 What do you mean by persist? You want to persis certain topic's message to database like Cassandra? I think you have 2 option. First is to write yourself a plugin and subscribe certain topics and then persist them into db. The 2nd option is to write yourself a small application (not necessary in Erlang) that subscribe to any topics you like and persist them into db. Personally, I prefer the 2nd option because the Unix philosophy "Do One Thing and Do It Well". The message broker itself shall not take that responsibility itself. And besides, if you are in a cluster situation you will have to persist the message many times unless you have a smart design on you plugin. (starting the plugin only in a single node is risky)

thank you su much,got an idea for it.

@emqplus In case of cluster and if we load plugin (to persist messages in cassandra) on all nodes of the cluster, will it save the same message multiple times or it will be only once from the broker which receives the message. Can you please confirm?
@turtleDeng @huangdan

@indrajeet0510 Only once. Only on the node your publisher is connected on.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mariusstaicu picture mariusstaicu  路  3Comments

stefano055415 picture stefano055415  路  4Comments

mikybone picture mikybone  路  3Comments

codewiget95 picture codewiget95  路  6Comments

arnecs-piscada picture arnecs-piscada  路  5Comments