@Configuration
public class NettyHttpServer implements ApplicationListener {
private static final Logger LOGGER = LoggerFactory.getLogger(NettyHttpServer.class);
@Value("${server.port}")
private int port;
@Resource
private InterceptorHandler interceptorHandler;
@Resource
private HttpServerHandler httpServerHandler;
@Override
public void onApplicationEvent(@NonNull ApplicationStartedEvent event) {
ServerBootstrap bootstrap = new ServerBootstrap();
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
bootstrap.group(bossGroup, workerGroup);
bootstrap.channel(NioServerSocketChannel.class);
bootstrap.childOption(NioChannelOption.TCP_NODELAY, true);
bootstrap.childOption(NioChannelOption.SO_