Skip to content

Commit

Permalink
fix apache#7815 MultiMessageHandler should increase exception handlin…
Browse files Browse the repository at this point in the history
…g to prevent data loss
  • Loading branch information
xiaoheng1 committed May 21, 2021
1 parent 1a7ca1e commit b214bee
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -16,17 +16,21 @@
*/
package org.apache.dubbo.remoting.transport;

import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.remoting.Channel;
import org.apache.dubbo.remoting.ChannelHandler;
import org.apache.dubbo.remoting.ExecutionException;
import org.apache.dubbo.remoting.RemotingException;
import org.apache.dubbo.remoting.exchange.support.MultiMessage;

/**
*
* @see MultiMessage
*/
public class MultiMessageHandler extends AbstractChannelHandlerDelegate {

protected static final Logger logger = LoggerFactory.getLogger(MultiMessageHandler.class);

public MultiMessageHandler(ChannelHandler handler) {
super(handler);
}
Expand All @@ -37,7 +41,12 @@ public void received(Channel channel, Object message) throws RemotingException {
if (message instanceof MultiMessage) {
MultiMessage list = (MultiMessage) message;
for (Object obj : list) {
handler.received(channel, obj);
try {
handler.received(channel, obj);
} catch (ExecutionException e) {
logger.error("MultiMessageHandler received fail.", e);
handler.caught(channel, e);
}
}
} else {
handler.received(channel, message);
Expand Down

0 comments on commit b214bee

Please sign in to comment.