Created
June 8, 2020 13:49
-
-
Save ihoneymon/9a5c908ae8cc1ee1f21434ddcebc277a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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