Question

I know db-xx.log is the journal file and db.redo is the reference file?

db-xx.log stores messages which are not consumed, yet. Those messages will be deleted from db-xx.log after being consumed. db.redo stores references of messages (which are stored in db-xx.log) by message id.

  1. But, what are db.data and db.free?
  2. What are their functions?

My understanding is that broker stores messages in cache (which is volatile memory) first, and then those messages are moved (appended) to db-xx.log when checkpoint or cache size is full.

  1. Is that correct?

Thanks

Was it helpful?

Solution

db.data holds btree pages which reference the un-consumed messages. The db.redo is a redo log of the updates that are about to be performed against the db.data. The db.free keeps track of the free pages in the db.data.

OTHER TIPS

db.redo is the recovery file for the indexes (db.data). db.free is read and loaded into memory during the start of activemq. The file is deleted once the free list is loaded into memory. Once the message database is unloaded, the free list is written back to db.free.

Once a message is removed, the behavior is different for queue/topic.

  • In case of queue, it will be removed from the index file. B-tree structure will be modified accordingly.
  • In case of topic, only when the message is acknowledged by all the subs, it will be removed.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top