|
KahaDB like the AMQ Message Store is a file based persistence database that is local the message broker that is using it. It makes some trade-offs for scalability and recovery versus performance compared to the AMQ Message Store. Although marginally slower, it is not limited by the number of file descriptors available to the message broker process and also recovery is extremely fast. ConfigurationYou can configure ActiveMQ to use KahaDB for its persistence adapter - like below : <broker brokerName="broker" persistent="true" useShutdownHook="false"> <persistenceAdapter> <kahaDB directory="activemq-data" journalMaxFileLength="32mb"/> </persistenceAdapter> <transportConnectors> <transportConnector uri="tcp://localhost:61616"/> </transportConnectors> </broker> KahaDB Properties
Slow KahaDB access log messagesIf database operation is slower than some threshold (default 500 ms), you will see messages like Slow KahaDB access: cleanup took 1277 | org.apache.activemq.store.kahadb.MessageDatabase | ActiveMQ Journal Checkpoint Worker You can configure a threshold used to log the message by using -Dorg.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_TIME=1500 system property and adjust it to your disk speed. |