You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continued analysis of startup time (Spring container, not Boot) shows several unnecessary (default) beans created. These can be avoided by providing a minimal set (instead of relying on defaults).
Unclear if these could/should be rolled into the container (that would be nice as an optional flag) or a documentation issue.
@Configuration
@ComponentScan("mypackage.controller")
public class AppConfig {
/*
* Create required HandlerMapping, to avoid several default HandlerMapping instances being created
*/
@Bean
public HandlerMapping handlerMapping() {
return new RequestMappingHandlerMapping();
}
/*
* Create required HandlerAdapter, to avoid several default HandlerAdapter instances being created
*/
@Bean
public HandlerAdapter handlerAdapter() {
return new RequestMappingHandlerAdapter();
}
/*
* optimization - avoids creating default exception resolvers; not required as the serverless container handles
* all exceptions
*
* By default, an ExceptionHandlerExceptionResolver is created which creates many dependent object, including
* an expensive ObjectMapper instance.
*/
@Bean
public HandlerExceptionResolver handlerExceptionResolver() {
return new HandlerExceptionResolver() {
@Nullable
@Override
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception ex) {
return null;
}
};
}
}```
The text was updated successfully, but these errors were encountered:
Continued analysis of startup time (Spring container, not Boot) shows several unnecessary (default) beans created. These can be avoided by providing a minimal set (instead of relying on defaults).
Unclear if these could/should be rolled into the container (that would be nice as an optional flag) or a documentation issue.
The text was updated successfully, but these errors were encountered: