Spring Boot Servlet Inherit Channel
Usage
Using Auto-configuration
@SpringBootApplication
@EnableServletInheritChannel
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
To start the application with inherited channel, set attribute server.inherit-channel
to true
(e.g. using CLI argument --server.inherit-channel=true
)
Without Auto-configuration
@Configuration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public JettyEmbeddedServletContainerFactory embeddedServletContainerFactory(
@Value("${server.inherit-channel:false}") boolean inheritChannel) {
JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory();
if (inheritChannel) {
factory.addServerCustomizers(new InheritChannelJettyServerCustomizer());
}
return factory;
}
}
How to get it?
Released versions are available in The Central Repository. Just add this artifact to your project:
Maven
<dependency>
<groupId>cz.jirutka.spring</groupId>
<artifactId>spring-boot-servlet-inherit-channel</artifactId>
<version>0.1.1</version>
</dependency>
Gradle
compile 'cz.jirutka.spring:spring-boot-servlet-inherit-channel:0.1.1'
However if you want to use the last snapshot version, you have to add the JFrog OSS repository:
Maven
<repository>
<id>jfrog-oss-snapshot-local</id>
<name>JFrog OSS repository for snapshots</name>
<url>https://oss.jfrog.org/oss-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Gradle
repositories {
maven {
url 'https://oss.jfrog.org/oss-snapshot-local'
}
}
Contributions
…are always welcome. Don’t hesitate to submit a bug report or a pull requests.
License
This project is licensed under Apache License 2.0.