简体   繁体   中英

Artemis STOMP message expiry

From the documentation I still do not understand how to configure the expiration of messages for the STOMP protocol in broker.xml.

We have a chat project in which "multicast" addresses are created for each chat

topic/chat.1, topic/chat.2, ..., topic/chat.100000

Among other things, we use " Durable Subscriptions ". Thus, even on our unpopular project, the number of topics per month can exceed 50,000, which causes the server to run out of memory, especially if we go to the web console.

I hope that when deleting expired messages, unnecessary addresses and queues will be automatically deleted

You can use the expiry-delay address-setting mentioned in the documentation to apply an expiration to all incoming messages, eg:

<address-setting match="#">
   <expiry-delay>300000</expiry-delay> <!-- 5 minutes -->
</address-setting>

If you're using ActiveMQ Artemis 2.12.0 or later then when the last message expires from an auto-created queue with no consumers then the queue will be auto-deleted by default (and if the corresponding auto-created address then has no queues it will also be auto-deleted by default).

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