๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

rabbitmq1

ํ•œ ํ”„๋กœ์ ํŠธ์—์„œ ๋‘ ๊ฐœ์˜ MQ Connection ์ •๋ณด ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์„ ๋•Œ MQ Broker๋Š” ๊ฐ™์ด ์‚ฌ์šฉ์ค‘์ธ๋ฐ, vHost๋ฅผ ๋ถ„๋ฆฌํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค. ๊ฒ€์ƒ‰์„ ํ•ด๋ดค๋Š”๋ฐ amqp์—์„œ ์ผ๋‹จ ์ด๋Ÿฐ ์ผ€์ด์Šค ์ง€์›์„ ์•ˆํ•˜๋Š” ๊ฒƒ ๊ฐ™์•˜๊ณ , ์–ด์ผ€ ํ• ์ง€ ๊ณ ๋ฏผํ•˜๊ณ  ์ฐพ์•„๋ณด๋‹ค๊ฐ€ RabbitConfig ์„ค์ • ํŒŒ์ผ ๋งŒ๋“ค์–ด ๋†“์€ ๊ณณ์— ๊ธฐ์กด์—” ๊ตฌ๋ƒฅ rabbitTemplate Autowired ํ•œ๊ฑธ ์‚ฌ์šฉํ–ˆ์œผ๋‚˜, ์›ํ•˜๋Š” ๋‘ connectionFactory์™€ rabbitTemplate๋ฅผ ์ƒˆ๋กœ bean์„ ๊ฐ๊ฐ ๋งŒ๋“ค์–ด์„œ ๊ตฌํ˜„ํ•ด์คฌ๋‹ค. ์•ฝ๊ฐ„ ๋˜‘๋˜‘ํ•˜๊ฒŒ ํ•ด์ฃผ๋Š”๊ฑธ ๋ฉ์ฒญํ•˜๊ฒŒ ๋‹ค์‹œ ๋ฐ”๊ฟ”๋ฒ„๋ฆฐ ๋Š๋‚Œ์ด์ž๋งŒ ์ผ๋‹จ์€ ๊ตฌ๋ถ„์„ ํ•˜๋Š”๊ฒŒ ๋ชฉ์ ์ด์—ˆ์œผ๋‹ˆ.. ์„ค์ • ๋ถ€๋ถ„ @Configuration public class RabbitMqConfig { @Resource private Environment environment; public final static.. 2022. 3. 5.