The default message store used by FUSE Message Broker is a light-weight transactional store that is fast and reliable. It is a hybrid system that couples a transactional journal for message storage and a reference store for quick retrieval. The AMQ message store is highly configurable.
By default, FUSE Message Broker uses the AMQ Message Store to persist message data. The AMQ message store is an embeddable, transactional message store that is extremely fast and reliable. It is an evolution of the Kaha system used by Active MQ 4.x. It uses a transactional journal to store message data and a Kaha-based index to store message locations for quick retrieval.
Figure 2.1 shows a high-level view of the AMQ message store.
Messages are stored in file-based data logs. When all of the messages in a data log have been successfully consumed, the data log is marked as ready to be deleted. At a predetermined clean-up interval, logs marked as deletable are removed from the system.
![]() | Note |
---|---|
Message logs can also be archived. |
An index of message locations is cached in memory to facilitate quick retrieval of message data. At configurable checkpoint intervals, the references are inserted into the persistent reference store.
The AMQ message store is a file-based message store and uses a layered directory structure to store its data. Figure 2.2 shows the layout of the AMQ message store's files.
The top-level directory of a broker's message store is identified by the name of the
broker. For example a broker configured with the name JoeFred
would
have a message store folder named JoeFred
. Beneath the message
store's top-level folder are four folders:
archive
The archive
folder stores archived message logs.
![]() | Note |
---|---|
This folder only exists when log archiving is activated. |
![]() | Tip |
---|---|
You can change the name of this folder by setting the AMQ persistence
adapter's |
journal
The journal
folder stores the active message
logs.
kr-store
The kr-store
folder is used by the Kaha reference
store when it saves message references to disk. It has two sub-folders:
![]() | Note |
---|---|
This folder is only used if the AMQ persistence adapter's |
tmp-storage
The tmp-storage
folder stores transient messages that
are cached to free up memory. For example non-persistent messages may be
stored here while awaiting consumption by an active, but slow
consumer.
FUSE Message Broker comes preconfigured to use the AMQ message store. However, you can modify how
the message store behaves by explicitly defining its persistence adapter using the
amqPersistenceAdapter
element as shown in Example 2.1.
Example 2.1. Configuring the AMQ Message Store
<broker brokerName="broker" persistent="true" useShutdownHook="false"> ... <persistenceAdapter> <amqPersistenceAdapter directory="activemq-data" maxFileLength="32mb"/> </persistenceAdapter> </broker>
Table 2.1 describes all of the attributes that can be used to configure the AMQ message store.
Table 2.1. Configuration Attributes for the AMQ Message Store