Hi!

I'm building a consumer which will be listening on text messages (I've no
control over producers). I want to protect my consumer such that it does
not read messages larger than 256KB to avoid crashing due to memory
limitations. Is there any way in artemis jms client implementation to see
if a text message is larger than given size without having to load it into
memory?

My understanding is that it's not possible when reading code of
ActiveMQTextMessage, specifically doBeforeReceive method, looks like it
loads the entire message into memory -
https://github.com/apache/activemq-artemis/blob/6f68668c867b23c7468f85c91c96a74136a561ad/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTextMessage.java#L104
Is my understanding correct?

Thank you in advance!

Reply via email to