You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/05/18 12:44:00 UTC
[jira] [Work logged] (ARTEMIS-5483) Provide option to abort consumption of large javax.jms.TextMessage on client side
[ https://issues.apache.org/jira/browse/ARTEMIS-5483?focusedWorklogId=969709&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-969709 ]
ASF GitHub Bot logged work on ARTEMIS-5483:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/May/25 12:43
Start Date: 18/May/25 12:43
Worklog Time Spent: 10m
Work Description: AlexejTimonin opened a new pull request, #5689:
URL: https://github.com/apache/activemq-artemis/pull/5689
Adds a new configuration option for Jakarta client consumers. When this configuration is set, the consumer will throw a ``javax.jms.JMSException`` receiving large text(type 3) message that would exceed the specified size (in bytes) when creating ``javax.jms.TextMessage``
``jmsMaxTextMessageSize`` is intended to prevent consumers of ``javax.jms.TextMessage`` from crashing due to out-of-memory when receiving messages that are larger than consumers memory.
The configuration is provided as a URL property when establishing a connection to the broker.
Example:
Throw on large text messages exceeding 10MB in size: ``tcp://localhost:61616?jmsMaxTextMessageSize=10000000``
Note:
This option relies on how core client consumer works. When message is above certain size threshold (default 100KB) it will be considered as a large message and be delivered in parts with headers first. With the help of headers we're able to determine the size of the incoming body and reject if it is above ``jmsMaxTextMessageSize``.
If the message is below large message threshold then this option has no real defensive effect since the message will be read into memory anyway.
Issue Time Tracking
-------------------
Worklog Id: (was: 969709)
Remaining Estimate: 0h
Time Spent: 10m
> Provide option to abort consumption of large javax.jms.TextMessage on client side
> ---------------------------------------------------------------------------------
>
> Key: ARTEMIS-5483
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5483
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: JMS
> Reporter: Alexej Timonin
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> This improvement request comes from thread in users@activemq.apache.org:
> Artemis JMS client: Can I stream body of ActiveMQTextMessage?
> https://lists.apache.org/thread/t2bmc8g6tod1wlqz062g46gpwv52v2y5
> Provide an option for clients using JMS api through artemis-jakarta-client to detect when a javax.jms.TextMessage is so large it would crash the client because of out-of-memory errors.
> As it is now, a buggy producer can send a text message (type 3) so large that it would crash the consumer because the current implementation of JMS consumer reads whole text message into memory.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact