2.2. Configuring the KahaDB Message Store
Overview
Red Hat JBoss A-MQ's default configuration includes a persistence adapter that uses a KahaDB message store. The default configuration is suitable for many use cases, but you will likely want to update it for individual broker instances. You do this using the attributes of the
kahaDB
element.
The basic configuration tells the broker where to write the data files used by the store.
The KahaDB message store also has a number of advanced configuration attributes that customize its behavior.
Basic configuration
The KahaDB message store is configured by placing a
kahaDB
element in the persistenceAdapter
element of your broker's configuration. The kahaDB
element's attributes are used to configure the message store.
The attributes, listed in Table 2.1, “Configuration Properties of the KahaDB Message Store”, all have reasonable default values, so you are not required to specify values for them. However, you will want to explicitly specify the location of the message store's data files by providing a value for the
directory
attribute. This will ensure that the broker will not conflict with other brokers.
Example 2.1, “Configuring the KahaDB Message Store” shows a basic configuration of the KahaDB message store. The KahaDB files are stored under the
activemq-data
directory.
Example 2.1. Configuring the KahaDB Message Store
<broker brokerName="broker" persistent="true" ... > ... <persistenceAdapter> <kahaDB directory="activemq-data" /> </persistenceAdapter> ... </broker>
Configuration attributes
Table 2.1, “Configuration Properties of the KahaDB Message Store” describes the attributes that can be used to configure the KahaDB message store.
Attribute | Default Value | Description |
---|---|---|
directory | activemq-data | Specifies the path to the top-level folder that holds the message store's data files. |
indexWriteBatchSize | 1000 | Specifies the number of B-tree indexes written in a batch. Whenever the number of changed indexes exceeds this value, the metadata cache is written to disk. |
indexCacheSize | 10000 | Specifies the number of B-tree index pages cached in memory. |
enableIndexWriteAsync | false | Specifies if kahaDB will asynchronously write indexes. |
journalMaxFileLength | 32mb | Specifies the maximum size of the data log files. |
enableJournalDiskSyncs | true | Specifies whether every non-transactional journal write is followed by a disk sync. If you want to satisfy the JMS durability requirement, you must also disable concurrent store and dispatch. |
cleanupInterval | 30000 | Specifies the time interval, in milliseconds, between cleaning up data logs that are no longer used. |
checkpointInterval | 5000 | Specifies the time interval, in milliseconds, between writing the metadata cache to disk. |
ignoreMissingJournalfiles | false | Specifies whether the message store ignores any missing journal files while it starts up. If false , the message store raises an exception when it discovers a missing journal file. |
checkForCorruptJournalFiles | false | Specifies whether the message store checks for corrupted journal files on startup and tries to recover them. |
checksumJournalFiles | true | Specifies whether the message store generates a checksum for the journal files. If you want to be able to check for corrupted journals, you must set this property to true . |
archiveDataLogs | false | Specifies if the message store moves spent data logs to the archive directory. |
directoryArchive | null | Specifies the location of the directory to archive data logs. |
databaseLockedWaitDelay | 10000 | Specifies the time delay, in milliseconds, before trying to acquire the database lock in the context of a shared master/slave failover deployment. See section "Shared File System Master/Slave" in "Fault Tolerant Messaging". |
maxAsyncJobs | 10000 | Specifies the size of the task queue used to buffer the broker commands waiting to be written to the journal. The value should be greater than or equal to the number of concurrent message producers. See Section 2.3, “Concurrent Store and Dispatch”. |
concurrentStoreAndDispatchTopics | false | Specifies if the message store dispatches topic messages to interested clients concurrently with message storage. See Section 2.3, “Concurrent Store and Dispatch”. |
concurrentStoreAndDispatchQueues | true | Specifies if the message store dispatches queue messages to clients concurrently with message storage. See Section 2.3, “Concurrent Store and Dispatch”. |
archiveCorruptedIndex | false | Specifies if corrupted indexes are archived when the broker starts up. |
useLock | true | Specifies in the adapter uses file locking. |