Question

I need to design a kind of data-logger using SQL database to be able to save the activity of each user for a specific time interval.

I noticed that, all of ActiveMQ's msg are stored in activemq_msgs table. However, this approach suffers from two shortcomings. First, once the msg is ack'd it's removed from the table. Second, it does not have any hierarchy, meaning that I cannot determine which msg belongs to which topic and which topic belongs to which user in this database. In other words, it is a flat database without any hierarchy or relationship. Any idea to handle it?

Was it helpful?

Solution

While this I don't know how to do this with ActiveMQ, you can see a blog post how to design a MQTT database logger in this blog post. This blog post uses HiveMQ but perhaps there is something similar for ActiveMQ available?

If you really don't want to go with a plugin approach (hint: you should!), then you can always have a MQTT subscriber which logs to a database. Please see the blog post linked above for a discussion why this isn't optimal.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top