Details
-
Story
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
False
-
None
-
False
Description
To efficiently manage disk space, it's necessary to identify the queue containing large messages. For instance, if the data/large-messages folder is expanding, users may want to purge the relevant queue to free up space. However, currently there's no straightforward method to determine which queue holds these large messages. The solution should also work well on OpenShift.
Workaround:
artemis data print - Print data records information. WARNING: don't use while a production server is running.
1. Print data info (it outputs a lot of data)
./artemis data print > export
2. Select records related to Large messages
grep "LargeMessage" export > large-messages
3. Discard "add record" operations to get the current large messages in the queues (the export contains the records related to the moment the message was sent, even when it's been consumed).
grep -vwE "AddRecord" large-messages > current-large-messages
Then, in the file current-large-messages, get lines like this one:
recordID=47;userRecordType=30;isUpdate=false;compactCount=0;LargeMessage(messageID=47;userMessageID=919bb095-bc71-11ee-b375-047bcb61f30a;msg=LargeServerMessage[messageID=47,durable=true,userID=919bb095-bc71-11ee-b375-047bcb61f30a,priority=4, timestamp=Fri Jan 26 18:37:25 CET 2024,expiration=0, durable=true, address=test.large.message2, properties=TypedProperties[__AMQ_CID=919017d1-bc71-11ee-b375-047bcb61f30a,_AMQ_ROUTING_TYPE=1,count=1,_AMQ_LARGE_SIZE=307200,ThreadSent=Producer ActiveMQQueue[test.large.message2], thread=0]]@1552076111
recordID/messageID matches the the filename in the filesystem, and you can see which is the address containing the record.