ARTEMIS-5483: New option - jmsMaxTextMessageSize#5689
ARTEMIS-5483: New option - jmsMaxTextMessageSize#5689AlexejTimonin wants to merge 2 commits intoapache:mainfrom
Conversation
26212a6 to
c792765
Compare
|
After thinking about this for awhile I believe this problem would be better solved with a new identifier that could be used in a consumer's filter. Currently we have
Would you be interested in modifying your PR to implement this? |
|
Thanks for getting back to me. I will modify my PR according to your suggestions. |
New filter identifier to enable filtering by whole message size.
c792765 to
74fd618
Compare
|
@jbertram I've made changes according to your suggestions. I agree that his approach is much better 👍 |
| The size of a message in bytes. | ||
| The value is an integer. | ||
|
|
||
| AMQFullSize:: |
There was a problem hiding this comment.
Having both AMQSize and AMQFullSize is likely going to be confusing to some users without a further elaboration in the docs about what makes them distinct and why you would use one over the other when using them to filter messages.
There was a problem hiding this comment.
I agree with @tabish121.
@AlexejTimonin, if you don't make the doc changes I'll do it myself in a few days.
There was a problem hiding this comment.
Yes, it's a good point. I will get to it tomorrow.
Adds a new configuration option for Jakarta client consumers. When this configuration is set, the consumer will throw a
javax.jms.JMSExceptionon receiving large text(type 3) message that would exceed the specified size (in bytes) when creatingjavax.jms.TextMessagejmsMaxTextMessageSizeis intended to prevent consumers ofjavax.jms.TextMessagefrom 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=10000000Note:
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.