io.kroxylicious.proxy.internal.codec.KafkaMessageDecoder Maven / Gradle / Ivy
/*
* Copyright Kroxylicious Authors.
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.kroxylicious.proxy.internal.codec;
import java.util.List;
import org.slf4j.Logger;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import io.kroxylicious.proxy.frame.Frame;
/**
* Abstraction for request and response decoders.
*/
public abstract class KafkaMessageDecoder extends ByteToMessageDecoder {
private final int socketFrameMaxSize;
protected abstract Logger log();
protected KafkaMessageDecoder(int socketFrameMaxSize) {
this.socketFrameMaxSize = socketFrameMaxSize;
}
@Override
public void decode(ChannelHandlerContext ctx, ByteBuf in, List