
com.wavefront.agent.channel.IncompleteLineDetectingLineBasedFrameDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proxy Show documentation
Show all versions of proxy Show documentation
Service for batching and relaying metric traffic to Wavefront
package com.wavefront.agent.channel;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.LineBasedFrameDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import org.apache.commons.lang3.StringUtils;
/**
* Line-delimited decoder that has the ability of detecting when clients have disconnected while
* leaving some data in the buffer.
*
* @author [email protected]
*/
public class IncompleteLineDetectingLineBasedFrameDecoder extends LineBasedFrameDecoder {
private final Consumer warningMessageConsumer;
IncompleteLineDetectingLineBasedFrameDecoder(
@Nonnull Consumer warningMessageConsumer, int maxLength) {
super(maxLength, true, false);
this.warningMessageConsumer = warningMessageConsumer;
}
@Override
protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy