broker/BrokerInterceptor: ByteBuf.retain & release added

broker/NettyMQTTHandler: ByteBuf.release added
broker/HazelcastListener: release added
broker/pom: leak detection enabled for surefire tests
broker: ReferenceCountUtil.release used
This commit is contained in:
Andreas Mager
2017-06-27 16:28:38 +02:00
parent 458840a0d7
commit 8e8a295200
4 changed files with 27 additions and 8 deletions
@@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.mqtt.*;
import io.netty.util.ReferenceCountUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static io.netty.handler.codec.mqtt.MqttQoS.AT_MOST_ONCE;
@@ -87,6 +88,8 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
LOG.error("Exception was caught while processing MQTT message, " + ex.getCause(), ex);
ctx.fireExceptionCaught(ex);
ctx.close();
} finally {
ReferenceCountUtil.release(msg);
}
}