๐ ์๋ก
SpringBoot๋ฅผ ์ฌ์ฉํ๋ฉด์ ๋ด์ฅ WAS๊ฐ ๋ํดํธ๋ก ์ค์ ๋์ด ์๋ Tomcat ์ด์ธ์ ๋ค๋ฅธ WAS๋ฅผ ์ฌ์ฉํด๋ณด๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์ ์์๋ ๊ฒ ๊ฐ๋ค.
SpringBoot ๊ด๋ จ ์คํฐ๋๋ฅผ ์งํํ๋ฉด์ ์๋์ ๊ฐ์ ํผ๋๋ฐฑ์ ๋ฐ์๊ณ , ์ด๋ฒ ๊ธฐํ์ ๋ค๋ฅธ WAS๋ฅผ ์ ์ฉํด๋ณด๋ ค๊ณ ํ๋ค.
๐ Tomcat, Jetty, Netty, Undertow
Tomcat, Jetty, Netty๋ ์์ธํ๋ ๋ชฐ๋ผ๋ ํ ๋ฒ์ฉ์ ๋ค์ด๋ดค๋ค. ์ฌ์ค Undertow๋ ์ฒ์ ๋ค์ด๋ดค๋ค.
ํผ๋๋ฐฑ ์ค์ Undertow๋ฅผ ์ ์ ์ฉ ํด๋ณด๋ผ๊ณ ํ๋ ๊ฒ์ผ๊น? ๋ผ๋ ์๊ฐ๊ณผ, Tomcat ๋ณด๋ค ์ฅ์ ์ด ์๊ธฐ ๋๋ฌธ์ด์ง ์์๊น? ๋ผ๊ณ ์๊ฐํ๋ค.
๊ทธ๋์ ๊ทธ๋ฅ ์ฌ์ฉํ๊ธฐ ๋ณด๋ค ๋ค๋ฅธ ์ ํ์ง๋ค์ ๋น๊ตํ๋ฉฐ ์ฌ์ฉํด๋ณด๋ ค๊ณ ํ๋ค.
Tomcat
- ์ปค๋ฎค๋ํฐ๊ฐ ํ๋ฐํ๋ฉฐ, ์๋ฐ ์ง์์์ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๊ณ ์๋ WAS์ด๋ค.
- ์คํ๋ง๋ถํธ์์ ๊ธฐ๋ณธ ๋ด์ฅ WAS๋ก ์ค์ ๋์ด ์๋ค.
- Tomcat์ ์๋น์ค์ ์ฌ์ฉํ๊ธฐ์ ๋ฌด๋ฆฌ๊ฐ ์๋ค๊ณ ํ๋ ๊ฐ๋ฐ์๋ ๋ณด์ธ๋ค.
- Tomcat 8.5๋ถํฐ ์ข์์ก๋ค๊ณ ํ์ง๋ง ์ฌ์ ํ ๋ฌธ์ ์ ์ด ์กด์ฌํ๋ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค.
์๋์ ๊ฐ์ด Tomcat์ ๋ฐ๋ก ์ถ๊ฐํ์ง ์์๋ ๊ธฐ๋ณธ์ ์ผ๋ก Tomcat์ด ์ค์ ๋๋ค.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
implementation('org.springframework.boot:spring-boot-starter-web')
Jetty
- ์ ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ๋ณ๊ณ , ๋น ๋ฅด๋ค.
- ๊ฒฝ๋ WAS๋ผ๊ณ ๋ ๋ถ๋ฆฐ๋ค.
- ๊ท๋ชจ๊ฐ ์๋ ํ๋ก์ ํธ์ ์ ์ฉํ๊ธฐ์ ๋ฌด๋ฆฌ๊ฐ ์์ง๋ง, ์์ ์ ์ํฉ์ ๋ง๊ฒ ์ ํํ๋ ๊ฒ์ด ์ข๋ค.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude module: 'spring-boot-starter-tomcat'
}
implementation('org.springframework.boot:spring-boot-starter-jetty')
Netty
- Async, Event-Driven ๋ฐฉ์์ ๋คํธ์ํฌ ์ ํ๋ฆฌ์ผ์ด์ ํ๋ ์์ํฌ์ด๋ค.
- Netty๋ Spring WebFlux์์ ๊ธฐ๋ณธ ๋ด์ฅ WAS์ผ๋ก ์ ๊ณต๋๋ค.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
implementation('org.springframework.boot:spring-boot-starter-webflux')
Undertow
- JBoss๋ J2EE ๊ท๊ฒฉ์ ๋ชจ๋ ๋ง์กฑํ๋ WAS๋ฅผ ์ ๊ณตํ๋๋ฐ ์ต๊ทผ Tomcat์ ๋ฒ๋ฆฌ๊ณ Netty๋ฅผ ๊ธฐ๋ฐ์ผ๋ก Undertow๋ฅผ ๋ง๋ค์๋ค.
- Undertow๋ฅผ ๊ณต์ ๋ฌธ์์์ ์๋์ ๊ฐ์ด ์๊ฐํ๊ณ ์๋ค.
- blocking๊ณผ non-blocking ๋ชจ๋ ์ฌ์ฉ๋๋๋ก ์ค๊ณ๋ ์น ์๋ฒ์ด๋ค. ์ฃผ์ ๊ธฐ๋ฅ์ ์๋์ ๊ฐ๋ค.
- High Performance
- Embeddable
- Servlet 4.0
- Web Sockets
- Reverse Proxy
- blocking๊ณผ non-blocking ๋ชจ๋ ์ฌ์ฉ๋๋๋ก ์ค๊ณ๋ ์น ์๋ฒ์ด๋ค. ์ฃผ์ ๊ธฐ๋ฅ์ ์๋์ ๊ฐ๋ค.
- ๋๊ท๋ชจ ํธ๋ํฝ์ผ๋ก๋ถํฐ Tomcat๋ณด๋ค ์์ ์ ์ด๋ผ๊ณ ํ๊ฐ๋ฅผ ๋ฐ๊ณ ์๋ค.
- ๋ฒค์น๋งํฌ ํ ์คํธ์์ ์์ ์ฑ์ ์ฆ๋ช ํ ์ฌ๋ก๊ฐ ๋ง์ด ๋ณด์ด๊ณ ์๋ค. (Tomcat๊ณผ Undertow ๋น๊ต)
org.springframework.boot.autoconfigure.web.servlet์์ ServletWebServerFactoryAutoConfiguration.java ๋ฅผ ์ด์ด๋ณด๋ฉด
์๋์ ๊ฐ์ด SpringBoot๋ Tomcat, Jetty์ ๋๋ถ์ด Undertow๋ฅผ ๋ด์ฅ WAS๋ก ์ฝ๊ฒ ์ค์ ํ ์ ์๊ฒ ์ง์ํ๊ณ ์๋ค.
...
@Import({ServletWebServerFactoryAutoConfiguration.BeanPostProcessorsRegistrar.class, EmbeddedTomcat.class, EmbeddedJetty.class, EmbeddedUndertow.class})
public class ServletWebServerFactoryAutoConfiguration {
...
๐ Undertow ์ ์ฉํ๊ธฐ
๋น๊ตํ๊ณ ๋ณด๋ ๋ํดํธ๋ก ์ ๊ณตํ๋ Tomcat๋ณด๋ค Undertow๊ฐ ๋ ๋ซ๋ค๊ณ ์๊ฐ์ด ๋ ๋ค.
(Spring WebFlux์์ ๊ธฐ๋ณธ ๋ด์ฅ WAS๋ฅผ Netty๋ก ์ ๊ณตํ๋ ๊ฒ์ ๋ณด๋ฉด, Tomcat์ ์๋๋ ์ง๋์ง ์์๊น..?)
Undertow๋ ์๋์ ๊ฐ์ด ์ค์ ํ๋ฉด ์ฌ์ฉํ ์ ์๋ค.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude module: 'spring-boot-starter-tomcat'
}
implementation('org.springframework.boot:spring-boot-starter-undertow')
๊ตฌ๋ ๋ชจ์ต
๐ ์ฐธ๊ณ ์๋ฃ
Undertow
There are two ways to end an exchange, either by fully reading the request channel, and calling shutdownWrites() on the response channel and then flushing it, or by calling HttpServerExchange.endExchange(). When endExchange() is called Undertow will check
undertow.io
Spring Boot ๊ณต์ ์ง์ ๋ด์ฅ WAS ์ธ Undertow ์ ์์๋ค.
Java ๊ฐ Web ๊ฐ๋ฐ์์ ๋๊ฐ์ ๋ํ๋ด๋ฉด์ WAS(Web Application Server) ๋ผ๋ ์ฉ์ด๋ฅผ ๋๋ฆฌ ์ฌ์ฉํ๊ฒ ๋ง๋ค์์ต๋๋ค. ์ฒ์์ ์๋์ ๋ฌ๋ฆฌ WAS ์ ์ง์นญํ๋ ์๋ฏธ๋ ์ ์ฐจ ํ๋๋์๊ณ , Java ์์๋ Apache Tomcat(์ดํ T
zepinos.tistory.com
Undertow ์ Tomcat ์ ๊ฐ๋จํ ๋น๊ต
2019/01/23 - [Programming/Java] - Spring Boot ๊ณต์ ์ง์ ๋ด์ฅ WAS ์ธ Undertow ์ ์์๋ค. ์ด์ ์ Spring Boot ์์ Embedded Tomcat ๋์ ์ Undertow ์ ์ฌ์ฉํ์๊ณ ๊ธ์ ์์ฑํ ์ ์ด ์์ต๋๋ค. ๊ธ์ ๋ด์ฉ์..
zepinos.tistory.com
Spring Boot ๋ด์ฅ WAS ์ข ๋ฅ์ ํน์ง
์คํ๋ง ๋ถํธ ๋ด์ฅ WAS์ ์ข ๋ฅ์ ํน์ง์ ๋๋ค. ์ต๋ํ ์ฝ๊ฒ ์ ์ด๋ดค์ด์. Tomcat ~7๋ฒ์ ๊น์ง ๋๊ท๋ชจ ํธ๋ํฝ์์ ๋ถ์์ ํ๋ค vs ์๋๋ค ๋ฑ์ ์๊ฒฌ์ด ๋ถ๋ถํ๊ณ , 8๋ฒ์ ์ ํญ๋งํ์ง๋ง, 8.5๋ฒ์ ์ผ๋ก ๋์ํ์ฌ
gofnrk.tistory.com
JBOSS
์คํ์์ค ๋ฏธ๋ค์จ์ด – ์ ์ด๋ณด์ค(JBoss) ์ ์ด๋ณด์ค(JBoss)๋ ์๋ฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๋ ์คํ ์์ค ๋ฏธ๋ค์จ์ด์ ์ด์นญ์ผ๋ก, ๋ํ์ ์ผ๋ก๋ Java EE ์คํ์์ง์ํ๋ ์ ์ด๋ณด์ค ์ ํ๋ฆฌ์ผ์ด์ ์๋ฒ๊ฐ ์๋ค. Ja
creator0609.tistory.com
'Spring' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๐ค @RequestBody - DTO, Map ๋ฌด์์ ์ ํํ ๊น? (0) | 2020.11.18 |
---|---|
๐ค @Component, @Bean, @Configuration ์ฐจ์ด๋ ๋ฌด์์ผ๊น? (0) | 2020.11.15 |
โ @Controller, @RestController ์ฐจ์ด์ (0) | 2020.03.20 |
โฐ WebTestClient Timeout (0) | 2020.03.20 |
๐ OSIV(Open Session In View) (0) | 2020.03.20 |