You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Michael Chen (JIRA)" <ji...@apache.org> on 2010/11/09 02:59:00 UTC
[jira] Commented: (AMQ-2929) Compressed text message received by
consumer uncompressed
[ https://issues.apache.org/activemq/browse/AMQ-2929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63188#action_63188 ]
Michael Chen commented on AMQ-2929:
-----------------------------------
Latest findings
============
An unconsumed message in a queue is decompressed when a JMX client code calls "browse()" on that Queue's MBean. Below is a stack trace captured by Eclipse (sorry about not having full class names).
"ActiveMQMonitorModule ... line: 86" is where our code calls the "browse" method of the Queue's MBean. This led to "ActiveMQTextMessage.getText() line: 83", which decompressed the message, allocating large amount of memory, and possibly killing the broker altogether.
Another side effect is that the message is permanently decompressed in the queue, and due to the other bug mentioned in my 9/22 comment, the consumer receives a message that is decompressed but with the wrong (isCompressed() == true) result.
Our work-around is to call the MBean's "browseMessages()" with the patch for AMQ-3023. However, if you use JConsole to browse the unconsumed messages, it too will trigger the decompression of messages (possibly killing the broker due to out of memory). A nasty booby trap.
One possible fix is for OpenTypeSupport.TextMessageOpenTypeFactory.getFields(Object) to check for m.isCompressed(), and if true not to call m.getText(). See line 367 of OpenTypeSupport.java.
{code}
Thread [SelfMonitor] (Evaluating)
InflaterInputStream(InputStream) line: 91 [local variables unavailable]
ActiveMQTextMessage.getText() line: 83 [local variables unavailable]
OpenTypeSupport$TextMessageOpenTypeFactory.getFields(Object) line: 367
OpenTypeSupport.convert(Message) line: 397
QueueView(DestinationView).browse(String) line: 151
QueueView(DestinationView).browse() line: 132
GeneratedMethodAccessor43.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
StandardMBeanIntrospector.invokeM2(Method, Object, Object[], Object) line: 93
StandardMBeanIntrospector.invokeM2(Object, Object, Object[], Object) line: 27
StandardMBeanIntrospector(MBeanIntrospector<M>).invokeM(M, Object, Object[], Object) line: 208
PerInterface<M>.invoke(Object, String, Object[], String[], Object) line: 120
StandardMBeanSupport(MBeanSupport<M>).invoke(String, Object[], String[]) line: 262
AnnotatedMBean(StandardMBean).invoke(String, Object[], String[]) line: 391
DefaultMBeanServerInterceptor.invoke(ObjectName, String, Object[], String[]) line: 836
JmxMBeanServer.invoke(ObjectName, String, Object[], String[]) line: 761
ActiveMQMonitorModule$1QueueValueAccessor.getValue() line: 86
ActiveMQMonitorModule$1QueueValueAccessor.getValue() line: 67
BaseModuleAttribute<D>.getCurrentValue() line: 106
ActiveMQMonitorModule(BaseMonitorModule).getCurrentModuleData() line: 105
MonitorData.populateModuleData(MonitorModule) line: 195
MonitorGenerator.process() line: 135
BaseRouteBuilder$1.run() line: 81
BaseRouteBuilder$2.run() line: 176
TimerThread.mainLoop() line: 512
TimerThread.run() line: 462
{code}
> Compressed text message received by consumer uncompressed
> ---------------------------------------------------------
>
> Key: AMQ-2929
> URL: https://issues.apache.org/activemq/browse/AMQ-2929
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Affects Versions: 5.3.2
> Environment: ActiveMQ 5.3.2 / Camel 2.2.0
> Reporter: Michael Chen
> Attachments: ActiveMQConsumerTest.java, ActiveMQConsumerTest.xml, ActiveMQProducerTest.java, ActiveMQProducerTest.xml
>
>
> I have a queue setup to send and consume compressed text messages. This is done via Spring setting ActiveMQConnectionFactory.useCompression to true. If the consumer connects to this queue before the first message is arrives, everything works great.
> If the messages are sent to this queue before the consumer connects, those early messages will cause ZipException "unknown compression method" when consumed by the belated consumer. Debugger shows that the ActiveMQTextMessage.content already contains the uncompressed text (with 4 leading length bytes) when ActiveMQTextMessage.getText() is called.
> If I set useCompression to false, early messages are consumed with no problems. Please look into this.
> I notice that after ActiveMQTextMessage.getText() decompress the message, it does not set compressed to false. Not sure if that is the cause.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.