arnoudja commented on PR #1851: URL: https://github.com/apache/activemq/pull/1851#issuecomment-4147777370
Hello Christopher, Thank you for looking into this. In our case, this change fixes the problem. We're currently running a custom build version of ActiveMQ, the memory usage is not an issue in our case. But I fully understand that this will cause problems for others so let's look for a solution that serves both cases. As an answer to your question: Synchronisation will solve this problem for us, but it won't solve other problems. The problem is that getText basically does the reverse of beforeMarshall. So if thread 1 calls beforeMarshall, thread 2 calls getText right afterwards and then thread 1 resumes, this will lead to problems in all of the following code in thread 1 that rely on beforeMarshall being called. Basic synchronisation within the ActiveMQTextMessage class won't avoid that, you'll need to block the call to getText between beforeMarshall and the last piece of code that depends on that. This doesn't seem to be just a theoretical scenario but seems possible in reality as well, though I haven't tried to reproduce it. See the xpath scenario described in my original message for more details. That results in my conclusion that synchronisation isn't only an expensive problem but also one that only solves part of the problems. As of the AMQP part: This has definitely something to do with the conversion between protocols. Most of our code uses Openwire to communicate with the broker and we don't see this empty message problem there. However, we do see the same problem with messages posted using STOMP instead of AMQP. This fix solves most of the problems for the STOMP posts as well (down from ~1% problem cases to ~0.1%). The remaining ~0.1% problem is probably an unrelated client side issue but I didn't look into that yet. So either the STOMP conversion has the same problem or the problem occurs in a piece of code used by both the AMQP and STOMP conversion. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information, visit: https://activemq.apache.org/contact
