@VisibleForTesting
    Bootstrap getBootstrap(MessageInput input) {
        LOG.debug("Setting UDP receive buffer size to {} bytes", getRecvBufferSize());
        final NettyTransportType transportType = nettyTransportConfiguration.getType();

        eventLoopGroup = eventLoopGroupFactory.create(workerThreads, localRegistry, "workers");

        return new Bootstrap()
                .group(eventLoopGroup)
                .channelFactory(new DatagramChannelFactory(transportType))
                .option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(65535)) // Maximum possible UDP packet size
                .option(ChannelOption.SO_RCVBUF, getRecvBufferSize())
                .option(UnixChannelOption.SO_REUSEPORT, true)
                .handler(getChannelInitializer(getChannelHandlers(input)))
                .validate();
    }
@Test
    public void receiveBufferSizeIsNotLimited() {
        final int recvBufferSize = Ints.saturatedCast(Size.megabytes(1L).toBytes());
        ImmutableMap<String, Object> source = ImmutableMap.of(
                NettyTransport.CK_BIND_ADDRESS, BIND_ADDRESS,
                NettyTransport.CK_PORT, PORT,
                NettyTransport.CK_RECV_BUFFER_SIZE, recvBufferSize);
        Configuration config = new Configuration(source);
        UdpTransport udpTransport = new UdpTransport(config, eventLoopGroupFactory, nettyTransportConfiguration, throughputCounter, new LocalMetricRegistry());

        assertThat(udpTransport.getBootstrap(mock(MessageInput.class)).config().options().get(ChannelOption.SO_RCVBUF)).isEqualTo(recvBufferSize);
    }