Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* @see <a href="https://www.baeldung.com/spring-xml-vs-java-config">web.xml vs Initializer with Spring</a>
* @see <a href="https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-customizing-embedded-containers"></a>
*/
@Configuration
public class CustomTomcatServletWebServerFactoryCustomizer
implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addContextCustomizers(new TomcatClusterContextCustomizer());
}
public class TomcatClusterContextCustomizer implements TomcatContextCustomizer {
@Override
public void customize(final Context context) {
context.setDistributable(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment