cshannon opened a new pull request, #2136:
URL: https://github.com/apache/activemq/pull/2136

   This PR improves the broker' handling of messages that are corrupt and can't 
be read, such as when unmarshaling the properties or body. Currently if there 
is an error an IOException is triggered and can lead to a client connection be 
closed. Furthermore for queues messages can be stuck and no new messages can be 
delivered.
   
   To improve things the following changes have been made:
   
   1. The MarshallingSupport utility that is used to unmarshal message 
properties and bodies has improve validation to check for errors such is 
incorrectly encoded size values. This prevents problems such as large buffers 
being allocated by mistake.
   2. The broker will now handle message format errors both when messages and 
there are two main spots to deal with it.
       * The first spot is when messages are published and a topic or queue try 
to match to consumers. The properties (or body for xpath) could be unmarshaled 
for for selector matching which could trigger an error which. The previous 
behavior just skips the message and continues. For topics this is makes sense 
because each sub is independently handled and will just ack/remove for an 
unmatching sub and it won't block any other sub. However for the queue case, we 
can end up in a loop and be "stuck" and need to DLQ.
       * The second spot is later during actual dispatch attempt to clients 
from the subscriptions. The primary cause of failure here is an error tying to 
convert for another protocol the headers/body. Currently this just triggers an 
IOException and closes the consumer but doesn't deal with the message. This PR 
will fix this so that errors that happen that we know are due to a corrupt 
message will be acked and DLQ'd so they get removed by the queue or durable
     
   3. The Stomp protocol converter was fixed to not auto ack or track acks 
until the message has been converted.
   4. AMQP no longer swallows message format errors and will throw so the erors 
can be handled by the TransportConnection.
   
   All of these changes allow the broker to deal with corrupt messages and 
remove them (and possibly DLQ) vs causing the connections to close or the 
messages to block consumers forever in the queue case.


-- 
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


Reply via email to