๐Ÿ‘จ‍๐Ÿ’ป kimtongting
article thumbnail
[Spring Property / Spring Scheduler] ์Šคํ”„๋ง ํ”„๋กœํผํ‹ฐ ์ ์šฉ / ์Šค์ผ€์ค„๋Ÿฌ / Spring Scheduler

์„œ์‹ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•  ๋•Œ, ๊ฐ€๋ณ€์˜ ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ๋Š” ์ •๋ณด๋Š” ๋ชจ๋‘ properties์— ๋„ฃ๋Š”๋‹ค. ํ•„์ž์˜ ๊ฒฝ์šฐ ํ”„๋กœ์ ํŠธ ๋ฐฐํฌ ์ˆœ์„œ์ธ 'DEV' -> 'STAGE' -> 'PROD' ์—์„œ 'STAGE' -> 'DEV' ๋กœ ๋‚ด๋ฆฌ๊ฑฐ๋‚˜, 'PROD' ๋‹จ๊ณ„์—์„œ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ์— ์ฃผ๋กœ ์“ฐ๊ณ  ์žˆ๋‹ค. config.flag.type ์— 'D', 'S', 'P' ๋กœ ๊ตฌ๋ถ„ํ•˜์—ฌ config.flag.type์ด 'D' ์ผ ๊ฒฝ์šฐ, DEV ์„œ๋ฒ„๋กœ ๋“ฑ๋กํ•œ config๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๊ณ  ๋ญ ๊ทธ๋Ÿฐ์‹์ด๋‹ค. ์„œ๋ฒ„๋ฅผ ์ค‘๋‹จํ•˜์ง€ ์•Š๊ณ  ์ด ํŒŒ์ผ๋งŒ์„ ์ˆ˜์ •ํ•จ์œผ๋กœ์จ ํ”„๋กœ์ ํŠธ์˜ ์„ค์ • ๊ฐ’๋“ค์„ ํ•ธ๋“ค๋ง ํ•œ๋‹ค๋Š” ์ ์—์„œ ๊ต‰์žฅํžˆ ์œ ์šฉํ•˜๋‹ค. ํ…Œ์ŠคํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค Spring ๊ตฌ์กฐ๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ตฌ์„ฑํ–ˆ๋‹ค๋ฉด ๊ต‰์žฅํžˆ ์‹ฌํ”Œํ•˜๋‹ค. ์ด๋ฏธ classpath:resources/application.pr..