Description
During the graalvm native compile, the Spring provided Feature org.springframework.aot.nativex.feature.PreComputeFieldFeature
will lead to all Netty native transports unavailable.
all reactor-netty related log during compile:
Field reactor.netty.internal.util.Metrics#isMicrometerAvailable set to false at build time
Field reactor.netty.internal.util.Metrics#isTracingAvailable set to false at build time
Field reactor.netty.resources.DefaultLoopIOUring#isIoUringAvailable set to false at build time
Field reactor.netty.resources.DefaultLoopEpoll#isEpollAvailable set to false at build time
Field reactor.netty.resources.DefaultLoopKQueue#isKqueueAvailable set to false at build time
Field reactor.netty.http.server.HAProxyMessageReader#isProxyProtocolAvailable set to false at build time
This is due to org.springframework.aot.nativex.feature.PreComputeFieldFeature
contains such a field match pattern: https://github.com/spring-projects/spring-framework/blob/32f128b6ba118ea42f6648cda94ed1de7afa75aa/spring-core/src/main/java/org/springframework/aot/nativex/feature/PreComputeFieldFeature.java#L48C4-L48C4
Pattern.compile(Pattern.quote("reactor.") + ".*#.*Available")
This causes all the properties used by reator-netty to detect native transports to be selected.
All those properties should be init at runtime not build time to let reactor-netty correctly chose netty native transport.
This problem cause broken of using r2dbc with unix domain socket on native image.
I'm not familiar with pattern, but I think it's a good idea to skip the reactor netty properties to fix this issue.