이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 13. Persistence


This chapter covers persistence and its configuration in HornetQ.
HornetQ handles its own persistence. It ships with a high-performance journal, which is optimized for messaging-specific use cases.
The HornetQ journal is append only with a configurable file size, which improves performance by enabling single write operations. It consists of a set of files on disk, which are initially pre-created to a fixed size and filled with padding. As server operations (add message, delete message, update message, etc.) are performed, records of the operations are appended to the journal until the journal file is full, at which point the next journal file is used.
A sophisticated garbage collection algorithm determines whether journal files can be reclaimed and re-used when all of their data has been deleted. A compaction algorithm removes dead space from journal files and compresses the data.
The journal also fully supports both local and XA transactions.
The majority of the journal is written in Java, but interaction with the file system has been abstracted to allow different pluggable implementations. The two implementations shipped with HornetQ are:
Java Non-blocking IO (NIO)
Uses standard Java NIO to interface with the file system. This provides extremely good performance and runs on any platform with a Java 6 or later runtime.
Linux Asynchronous IO (AIO)
Uses a native code wrapper to talk to the Linux asynchronous IO library (AIO). With AIO, HornetQ receives a message when data has been persisted. This removes the need for explicit syncs. AIO will typically provide better performance than Java NIO, but requires Linux kernel 2.6 or later and libaio.
AIO also requires ext2, ext3, ext4, jfs or xfs type file systems. On NFS, AIO falls back to slower, synchronous behavior.

Note

On Red Hat Enterprise Linux, install libaio with the following command:
yum install libaio
Copy to Clipboard Toggle word wrap
The standard HornetQ core server uses the following journal instances:
bindings journal
Stores bindings-related data, including the set of queues deployed on the server and their attributes. It also stores data such as ID sequence counters. The bindings journal is always a NIO journal, as it typically has low throughput in comparison to the message journal.
The files on this journal are prefixed as hornetq-bindings. Each file has a bindings extension. File size is 1048576 bytes, and it is located in the bindings folder.
JMS journal
Stores all JMS-related data, for example, any JMS queues, topics or connection factories and any JNDI bindings for these resources. Any JMS resources created with the management API are persisted to this journal. Any resources configured with configuration files are not. This journal is created only if JMS is in use.
message journal
Stores all message-related data, including messages themselves and duplicate-id caches. By default, HornetQ uses AIO for this journal. If AIO is not available, it will automatically fall back to NIO.
Large messages are persisted outside the message journal. For more information see Chapter 21, Large Messages.
In low memory situations, configure HornetQ to page messages to disk. See Chapter 22, Paging for more information.
If persistence is not required, HornetQ can be configured not to persist any data, as discussed in Section 13.4, “Configuring HornetQ for Zero Persistence”.

13.1. Configuring the bindings journal

The bindings journal is configured using the following attributes in <JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml.
bindings-directory
The location of the bindings journal. The default value is data/bindings.
create-bindings-dir
If true, and the bindings directory does not exist, the bindings directory is created automatically at the location specified in bindings-directory. The default value is true.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat