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.
Table 2.1. Configuration Properties of the KahaDB Message Store
AttributeDefault ValueDescription
directory activemq-dataSpecifies the path to the top-level folder that holds the message store's data files.
indexWriteBatchSize 1000Specifies 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 10000Specifies the number of B-tree index pages cached in memory.
enableIndexWriteAsync falseSpecifies if kahaDB will asynchronously write indexes.
journalMaxFileLength 32mbSpecifies the maximum size of the data log files.
enableJournalDiskSyncs trueSpecifies 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 30000Specifies the time interval, in milliseconds, between cleaning up data logs that are no longer used.
checkpointInterval 5000Specifies the time interval, in milliseconds, between writing the metadata cache to disk.
ignoreMissingJournalfiles falseSpecifies 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 falseSpecifies whether the message store checks for corrupted journal files on startup and tries to recover them.
checksumJournalFiles trueSpecifies 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 falseSpecifies if the message store moves spent data logs to the archive directory.
directoryArchive nullSpecifies the location of the directory to archive data logs.
databaseLockedWaitDelay 10000Specifies 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 10000Specifies 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 falseSpecifies if the message store dispatches topic messages to interested clients concurrently with message storage. See Section 2.3, “Concurrent Store and Dispatch”.
concurrentStoreAndDispatchQueues trueSpecifies if the message store dispatches queue messages to clients concurrently with message storage. See Section 2.3, “Concurrent Store and Dispatch”.
archiveCorruptedIndex falseSpecifies if corrupted indexes are archived when the broker starts up.
useLocktrueSpecifies in the adapter uses file locking.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.