https://zzangjava.tistory.com/m/964
- webClient의 Mono vs Flux
Mono : 0 - 1개의 객체 처리를 위한 Reactor 객체
Flux : 0 - N개의 객체 처리를 위한 Reactor 객체- Extract a Mono’s Contenthttps://www.baeldung.com/java-string-from-mono
- webClient logging
https://happycloud-lee.tistory.com/m/220
https://www.baeldung.com/spring-log-webclient-calls- logging with coRouter filterhttps://medium.com/riiid-teamblog-kr/spring-webflux-%EC%97%90%EC%84%9C-corouter-filter%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%98%EC%97%AC-request-response-%EB%A1%9C%EA%B9%85%ED%95%98%EA%B8%B0-df56f9d9680
- logging with jetty
https://dev.to/stevenpg/logging-with-spring-webclient-2j6o
- logging with jetty 사용시 response status = 401일 경우 response 못 받는 오류 해결 옵션
Before removing the protocol handler HttpClient must be started:
final HttpClient httpClient = new HttpClient();
httpClient.start();
httpClient.getProtocolHandlers().remove(WWWAuthenticationProtocolHandler.NAME);
https://github.com/jetty-project/jetty-reactive-httpclient/issues/33
- jetty-reactive-httpclient version 주의(?)
https://stackoverflow.com/questions/70769259/jettyreactiveclient-noclassdeffounderror-in-tests- logging 해볼것https://stackoverflow.com/questions/45240005/how-to-log-request-and-response-bodies-in-spring-webflux
- logging with webFilter (동작 안함)
https://egkatzioura.com/2021/06/21/keeping-track-of-requests-and-responses-on-spring-webflux/
- json list 처리
https://www.baeldung.com/spring-webclient-json-list
- timeout 설정
https://www.baeldung.com/spring-webflux-timeout
- erroe handling
https://careydevelopment.us/blog/spring-webflux-how-to-handle-errors-with-webclienthttps://stackoverflow.com/questions/44593066/spring-webflux-webclient-get-body-on-errorhttps://withhamit.tistory.com/m/184응답이 200이고 응답 body에 대한 처리만 하고 싶은 경우 retrieve.이 외에 응답 코드가 4xx, 5xx 등 특정 코드에 따라 다른 결과를 주고 싶거나 응답 헤더를 사용하고 싶은 경우는 exchange를 사용하자. https://www.baeldung.com/spring-webflux-errors
- 2022-01-17 Add
https://medium.com/@odysseymoon/spring-webclient-%EC%82%AC%EC%9A%A9%EB%B2%95-5f92d295edc0
====================================================================================================
- restTemplate logging
https://www.baeldung.com/spring-resttemplate-logging
- 한글
restTemplate.getMessageConverters().add(0, new StringHttpMessageConverter(Charset.forName("UTF-8")));
https://kang8374.tistory.com/m/6
- error handling
https://stackoverflow.com/questions/16194014/spring-mvc-resttemplate-launch-exception-when-http-404-happens
try {
ResponseEntity<StoreDto> r = restTemplate.getForEntity(url, StoreDto.class, m);
}
catch (final HttpClientErrorException e) {
System.out.println(e.getStatusCode());
System.out.println(e.getResponseBodyAsString());
}https://www.baeldung.com/spring-rest-template-error-handling
'spring-webflux' 카테고리의 다른 글
Apache HttpClient Configuration for WebClient (1) | 2023.11.23 |
---|---|
Mockito 로 WebClient 테스트 하기 (0) | 2022.06.01 |
WebClient (0) | 2021.05.31 |
WebClient vs RestTemplate (0) | 2020.09.13 |