简体   繁体   中英

ActiveMQ Artemis is not persistent

I am using ActiveMQ Artemis for data delivery, but the data in the queue is not persistent.

When I bring down the server using artemis.cmd stop and restart using artemis.cmd run, the message count in the queue becomes 0.

Broker.xml :

<persistence-enabled>true</persistence-enabled>
<max-disk-usage>100</max-disk-usage>

There are a handful of broker and client details that need to be accounted for to ensure messages are persisted to disk.

  1. Ensure persistence is enabled on the broker using <persistence-enabled>true</persistence-enabled> . You've already done this so you're in good shape there.
  2. Ensure the <queue> you're working with is "durable." This is true by default so it doesn't need to be explicitly set on the queue, but if you wanted to set it you would do so with <durable>true</durable> .
  3. Ensure your client sends the message as persistent. Different protocols and APIs have different defaults so it really depends on what you're using as to how you configure the persistence of the message itself.

To be clear, the <max-disk-usage> parameter doesn't control message persistence. It controls the amount of disk the broker will consume before it starts blocking message production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM