Configuration and @EnableIntegration

@EnableIntegration

@EnableIntegration annotation์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ปจํ…์ŠคํŠธ์— ๋งŽ์€ ์ธํ”„๋ผ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

  • errorChannel ๋ฐ ํ•ด๋‹น LoggingHandler, pollers์šฉ taskScheduler, jsonPath SpEL-function, ๋“ฑ๊ณผ ๊ฐ™์€ ์ผ๋ถ€ ๋‚ด์žฅ ๋นˆ์„ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

  • ์ „์—ญ ๋ฐ ๊ธฐ๋ณธ ํ†ตํ•ฉ ํ™˜๊ฒฝ์„ ์œ„ํ•œ BeanFactory๋ฅผ ํ–ฅ์ƒ์‹œํ‚ค๊ธฐ ์œ„ํ•ด ์—ฌ๋Ÿฌ BeanFactoryPostProcessor ์ธ์Šคํ„ด์Šค๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

  • ์—ฌ๋Ÿฌ BeanPostProcessor ์ธ์Šคํ„ด์Šค๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ํ†ตํ•ฉ ๋ชฉ์ ์œผ๋กœ ํŠน์ • ๋นˆ์„ ํ–ฅ์ƒ ๋˜๋Š” ๋ณ€ํ™˜ ๋ฐ ๋ž˜ํ•‘ํ•ฉ๋‹ˆ๋‹ค.

  • ๋ฉ”์‹œ์ง• annotation์„ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๊ธฐ ์œ„ํ•ด annotation ํ”„๋กœ์„ธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ์ปจํ…์ŠคํŠธ์— ๋Œ€ํ•œ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

@IntegrationComponentScan

Spring Integration๊ณผ ๊ด€๋ จ๋œ ๊ตฌ์„ฑ ์š”์†Œ ๋ฐ ์ฃผ์„์œผ๋กœ ์ œํ•œํ•˜์—ฌ ์Šค์บ”ํ•œ๋‹ค.(์˜ˆ: @MessagingGateway )

@EnablePublisher

@EnablePublisher ์–ด๋…ธํ…Œ์ด์…˜์€ PublisherAnnotationBeanPostProcessor ๋นˆ์„ ๋“ฑ๋กํ•˜๊ณ  ์ฑ„๋„ ์†์„ฑ ์—†์ด ์ œ๊ณต๋˜๋Š” @Publisher ์–ด๋…ธํ…Œ์ด์…˜์— ๋Œ€ํ•ด default-publisher-channel์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค

๋‘˜ ์ด์ƒ์˜ @EnablePublisher์ฃผ์„์ด ๋ฐœ๊ฒฌ๋˜๋ฉด ๋ชจ๋‘ ๊ธฐ๋ณธ ์ฑ„๋„์— ๋Œ€ํ•ด ๋™์ผํ•œ ๊ฐ’์„ ๊ฐ€์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

@GlobalChannelInterceptor

@GlobalChannelInterceptor ์–ด๋…ธํ…Œ์ด์…˜์€ ๊ธ€๋กœ๋ฒŒ ์ฑ„๋„ ์ฐจ๋‹จ์„ ์œ„ํ•ด ChannelInterceptor ๋นˆ์„ ํ‘œ์‹œํ•˜๊ธฐ ์œ„ํ•ด ๋„์ž…๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

@GlobalChannelInterceptor ์–ด๋…ธํ…Œ์ด์…˜์€ ํด๋ž˜์Šค ๋ ˆ๋ฒจ(@Component์Šคํ…Œ๋ ˆ์˜คํƒ€์ž… ์–ด๋…ธํ…Œ์ด์…˜ ํฌํ•จ) ๋˜๋Š” @Configuration ํด๋ž˜์Šค ๋‚ด์˜ @Bean ๋ฉ”์†Œ๋“œ์— ๋ฐฐ์น˜๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‘ ๊ฒฝ์šฐ ๋ชจ๋‘ Bean์€ ChannelInterceptor๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

@IntegrationConverter

@IntegrationConverter ์ฃผ์„์€ converter, GenericConverter ๋˜๋Š” ConverterFactory ๋นˆ์„ integrationConversionService์˜ ํ›„๋ณด ๋ณ€ํ™˜๊ธฐ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

Reference

Last updated

Was this helpful?