Joke Collection Website - Public benefit messages - What is the reason why activemq rewrites the message expiration method instead of the messageExpired method? I am
What is the reason why activemq rewrites the message expiration method instead of the messageExpired method? I am
One. Persistence as a file
By default, ActiveMQ supports this method as long as you set the message to be persistent when sending it.
Open the configuration file in the installation directory:
D: \ ActiveMQ \ Apache-ActiveMQ \ conf \ ActiveMQ.xml found the default configuration item after 80 lines:
& lt persistence adapter & gt
& ltkah ADB directory =“$ { ActiveMQ . data }/kah ADB“/& gt。
& lt/persistence adapter & gt;
Please note that kahaDB is used here, which is a file-based message memory, supports transactions, and is a reliable, high-performance and extensible message memory.
His original intention was to use it simply and quickly. KahaDB's index uses the transaction log, and all destinations use only one index. Some tests show that if it is used in a production environment, it supports 10000 active connections, and each connection has an independent queue. This performance is enough to meet most requirements.
Then change the second parameter to:
MsgDeliveryMode。 persistent
There are two ways to save messages.
Persistence: Save to disk, and the message will be deleted after consumption by consumers.
NON_PERSISTENT: Save to memory, and the message will be cleared after consumption.
Note: Accumulating too many messages may lead to memory overflow.
Then open the generator and send a message:
wps30F4.tmp
Do not start the consumer, and at the same time view in the management interface:
wps3 105.tmp
I found a message waiting. At this point, if there is no persistence, the message will be lost after restarting ActiveMQ, but now we modify it to file persistence, and consumers can still receive this message after restarting ActiveMQ.
wps3 106.tmp
- Previous article:On graduation message
- Next article:Implementation plan of network education and teaching during the epidemic period (5 selected articles)
- Related articles
- Blizzard clothing can't change the password
- Jiangsu market supervision registration failed to receive verification code.
- My mobile phone number was hacked. Can he receive my message?
- How to apply for body donation
- May Day blessing message to insurance customers.
- How to fill in the college entrance examination registration if the political outlook is not in the group? .
- How to remove the micro-store logo on WeChat? How to do it specifically?
- How to make WeChat love confession 14 characters?
- Has fund-raising tourism been cleaned up by the state?
- How to retrieve deleted messages? Oppo has no backup.