📄 학습내용
WebFlux
- WebFlux에서 H2 Console 사용 방법
webFlux 가 servelet 기반이 아니라 H2 Console 을 못만들어주는데 설정이 필요로 합니다. @Slf4j
@Component
//@Profile("local")
public class H2Console {
private Server webServer;
@EventListener(ContextRefreshedEvent.class)
public void start() throws java.sql.SQLException {
log.info("starting h2 console at port 8078");
this.webServer = org.h2.tools.Server.createWebServer("-webPort", "8078", "-tcpAllowOthers").start();
}
@EventListener(ContextClosedEvent.class)
public void stop() {
log.info("stopping h2 console at port 8078");
this.webServer.stop();
}
} // 요로케 8078 포트로 h2 console 진입 할 수 있습니다. // build.gradle 에는 implementation 'com.h2database:h2' 추가 해주시고... 쿼리문은 r2dbc 로 나갑니다.
r2dbc:
url: r2dbc:h2:mem:///test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password:
yml 은 요거 추가 하시면 되요
주제
주제
주제
주제
주제
🧶 발생한 문제 및 해결방법
- 문제점)
- 해결방법)
- 문제점)
- 해결방법)
- 문제점)
- 해결방법)
⭐ 공부 난이도
☆★
🎡 페어리뷰
🌕 느낀점
'코드스테이츠 - 3회차 백엔드 부트캠프 > Section 4' 카테고리의 다른 글
2022.12.05 월 (0) | 2022.12.05 |
---|---|
2022.12.02 금 (0) | 2022.12.02 |
2022.11.30 수 (0) | 2022.11.30 |
2022.11.29 화 (0) | 2022.11.29 |
2022.11.28 월 (0) | 2022.11.28 |