-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Feature description
In an attempt to reduce the native image size we opted for the option of selecting servlet runtime to be Apache-http-poja, Netty, Jetty, or Tomcat at build time using classpath based bean discovery. The goal of this meeting is to explore possibilities to allow user to defer the selection to runtime. This has two important benefits:
- User can create a single image and decide whether to run it as a (serverless) function or server at runtime depending on usage of the application.
- Current solution may not work with layered native image where all the runtimes may be present in classpath.
The runtime selection seems to be done in the following code in Micronaut.start():
EmbeddedApplication<?> embeddedApplication = (EmbeddedApplication)applicationContext.findBean(EmbeddedApplication.class).orElse((Object)null);
Can we annotate ApacheServerlessApplication with @requires(condition = CustomConditition.class) where CustomCondition is defined something like this?
`
public class CustomCondition implements Condition {
public boolean matches(ConditionContext context) {
return System.inheritedChannel() instanceOf SocketInputChannel || Boolean.valueOf(System.getProperty("HTTP_POJA"));
}
}
`