ACTIVEMQ use Notes (ii) ACTIVEMQ message Persistence One

Source: Internet
Author: User
Tags amq

Original address: http://www.huaishao8.com/config/activemq/122.html

Set the property persistent= "true" in broker (the default is True) and the message sent at the same time should be persitent type. There are three ways of ACTIVEMQ message persistence: AMQ, KAHADB, and JDBC. 1, Amq

AMQ is a form of file storage, which has the characteristics of fast writing speed and easy recovery. Messages are stored in one file, the default size of the file is 32 megabytes, and if the size of a message exceeds 32 trillion, the value must be set to a larger point. When a message in a storage file is consumed, the file is identified as removable, and the file is deleted during the next cleanup phase. The default configuration is as follows:
< Persistenceadapter >
< Amqpersistenceadapter directory = "Activemq-data" maxfilelength = "32MB"/>
</persistenceadapter >

Properties of AMQ:

Property name Default value Describe
Directory Activemq-data Storage directory for message files and logs
Usenio True Storing messages using the NIO protocol
Synconwrite False Write to disk synchronously, this option has a very high performance impact
Maxfilelength 32mb The size of a message file
Persistentindex True Persistence of the message index, if False, so that the index is saved in memory
Maxcheckpointmessageaddsize 4kb Maximum number of messages allowed for a transaction
CleanupInterval 30000 Clear operation Cycle, Unit MS
Indexbinsize 1024 Index file cache number of pages, the default is 1024, when the AMQ expansion or reduced storage, will lock the entire broker, resulting in a certain amount of time blocking, so this value should be adjusted to relatively large, but the implementation of the code will be dynamic scaling, the adjustment effect is not ideal.
Indexkeysize 96 Size of index key, key is message ID
Indexpagesize 16kb Page size of index
Directoryarchive Archive Storing archived message file directories
Archivedatalogs False When true, archived message files are moved to directoryarchive instead of being deleted directly
ACTIVEMQ Use Notes (ii) ACTIVEMQ message Persistence two Original Address: http://www.huaishao8.com/config/activemq/132.html

KAHADB

KAHADB is a file-based local database storage format, although not amq fast, but it has strong scalability, recovery time than AMQ, from the 5.4 version after the KAHADB as the default persistent way. The default configuration is as follows:
< Persistenceadapter >
< kahadb directory = "Activemq-data" journalmaxfilelength = "32MB"/>
</persistenceadapter >


Properties of KAHADB:

Property name Default value Comments
Directory Activemq-data Storage directory for message files and logs
Indexwritebatchsize 1000 The size of a batch of indexes, updated to the message file when the amount of index to be updated reaches this value
Indexcachesize 10000 In memory, the page size of the index
Enableindexwriteasync False Whether the index is written asynchronously to the message file
Journalmaxfilelength 32mb The size of a message file
Enablejournaldisksyncs True Whether to write asynchronous messages to disk
CleanupInterval 30000 Clear operation Cycle, Unit MS
Checkpointinterval 5000 Index writes to the message file's cycle, Unit ms
Ignoremissingjournalfiles False Ignore missing message file, False, when missing message file, start exception
Checkforcorruptjournalfiles False Check that the message file is corrupted, true, and check that the corruption will attempt to repair
Checksumjournalfiles False Generates a checksum to be able to detect damage to the journal file.
Properties that are valid after version 5.4:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.