springboot 2

# Java - ScheduledExecutorService ์™€ Springboot ์˜ @Scheduled ์˜ˆ์ œ

ํŠน์ • ์ฃผ๊ธฐ๋งˆ๋‹ค ์–ด๋–ค ๋™์ž‘์„ ์ˆ˜ํ–‰(์Šค์ผ€์ค„๋ง)ํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•  ๋•Œ, ๊ตฌํ˜„ ๋ฐฉ๋ฒ•์€ ๋‹ค์–‘ํ•  ๊ฒƒ์ด๋‹ค. ๊ทธ ์ค‘์—์„œ ์˜ค๋Š˜์€ ScheduledExecutorService ์™€ Springboot์˜ @Scheduled ๋ฅผ ์ด์šฉํ•œ ์Šค์ผ€์ค„๋ง ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋ ค๊ณ  ํ•œ๋‹ค. 1. ScheduledExecutorService ๋จผ์ € ScheduledExecutorService๋Š” Java 1.5๋ถ€ํ„ฐ ์ง€์›๋˜๋Š” ์Šค์ผ€์ค„๋ง์ด ๊ฐ€๋Šฅํ•œ Executor ์„œ๋น„์Šค๋กœ ์ธํ„ฐํŽ˜์ด์Šค์ด๋ฉฐ, ๊ตฌํ˜„์ฒด๋กœ ScheduledThreadPoolExecutor() ๊ฐ€ ์žˆ๋‹ค. ScheduledExecutorService๋Š” 3๊ฐ€์ง€์˜ ์ง€์—ฐ ์Šค์ผ€์ค„๋ง ๋ฐฉ์‹์„ ์ง€์›ํ•œ๋‹ค. /** * ์ง€์ •๋œ dealy ์‹œ๊ฐ„๋งŒํผ ์ง€์—ฐ ํ›„์— 1๋ฒˆ์˜ command๋ฅผ ์‹คํ–‰ํ•œ๋‹ค. * * @param co..

JAVA/SpringBoot 2020.05.08

# Spring Boot # Content type 'text/plain;charset=UTF-8' not supported

@RequestMapping ๊ฐ’์„ ๋ฐ›์œผ๋ ค๋Š”๋ฐ ์•„๋ž˜ Error ๋ฐœ์ƒ [์‹œ๊ฐ„] WARN 8 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported] ํ•ด๊ฒฐ๋ฒ• Headers์— Content-Type:application/json ์„ ๋„ฃ์–ด๋ผ.

JAVA/Error 2019.10.24