Configuration and @EnableIntegration
@EnableIntegration
@EnableIntegration @EnableIntegration annotation์ ์ ํ๋ฆฌ์ผ์ด์ ์ปจํ ์คํธ์ ๋ง์ ์ธํ๋ผ ๊ตฌ์ฑ ์์๋ฅผ ๋ฑ๋กํฉ๋๋ค.
errorChannel๋ฐ ํด๋นLoggingHandler, pollers์ฉtaskScheduler,jsonPath SpEL-function, ๋ฑ๊ณผ ๊ฐ์ ์ผ๋ถ ๋ด์ฅ ๋น์ ๋ฑ๋กํฉ๋๋ค.์ ์ญ ๋ฐ ๊ธฐ๋ณธ ํตํฉ ํ๊ฒฝ์ ์ํ
BeanFactory๋ฅผ ํฅ์์ํค๊ธฐ ์ํด ์ฌ๋ฌBeanFactoryPostProcessor์ธ์คํด์ค๋ฅผ ์ถ๊ฐํฉ๋๋ค.์ฌ๋ฌ
BeanPostProcessor์ธ์คํด์ค๋ฅผ ์ถ๊ฐํ์ฌ ํตํฉ ๋ชฉ์ ์ผ๋ก ํน์ ๋น์ ํฅ์ ๋๋ ๋ณํ ๋ฐ ๋ํํฉ๋๋ค.๋ฉ์์ง annotation์ ๊ตฌ๋ฌธ ๋ถ์ํ๊ธฐ ์ํด annotation ํ๋ก์ธ์๋ฅผ ์ถ๊ฐํ๊ณ ์์ฉ ํ๋ก๊ทธ๋จ ์ปจํ ์คํธ์ ๋ํ ๊ตฌ์ฑ ์์๋ฅผ ๋ฑ๋กํฉ๋๋ค.
@IntegrationComponentScan
@IntegrationComponentScanSpring Integration๊ณผ ๊ด๋ จ๋ ๊ตฌ์ฑ ์์ ๋ฐ ์ฃผ์์ผ๋ก ์ ํํ์ฌ ์ค์บํ๋ค.(์: @MessagingGateway )
@EnablePublisher
@EnablePublisher@EnablePublisher ์ด๋
ธํ
์ด์
์ PublisherAnnotationBeanPostProcessor ๋น์ ๋ฑ๋กํ๊ณ ์ฑ๋ ์์ฑ ์์ด ์ ๊ณต๋๋ @Publisher ์ด๋
ธํ
์ด์
์ ๋ํด default-publisher-channel์ ๊ตฌ์ฑํฉ๋๋ค
๋ ์ด์์ @EnablePublisher์ฃผ์์ด ๋ฐ๊ฒฌ๋๋ฉด ๋ชจ๋ ๊ธฐ๋ณธ ์ฑ๋์ ๋ํด ๋์ผํ ๊ฐ์ ๊ฐ์ ธ์ผ ํฉ๋๋ค.
@GlobalChannelInterceptor
@GlobalChannelInterceptor@GlobalChannelInterceptor ์ด๋
ธํ
์ด์
์ ๊ธ๋ก๋ฒ ์ฑ๋ ์ฐจ๋จ์ ์ํด ChannelInterceptor ๋น์ ํ์ํ๊ธฐ ์ํด ๋์
๋์์ต๋๋ค.
@GlobalChannelInterceptor ์ด๋
ธํ
์ด์
์ ํด๋์ค ๋ ๋ฒจ(@Component์คํ
๋ ์คํ์
์ด๋
ธํ
์ด์
ํฌํจ) ๋๋ @Configuration ํด๋์ค ๋ด์ @Bean ๋ฉ์๋์ ๋ฐฐ์น๋ ์ ์์ต๋๋ค. ๋ ๊ฒฝ์ฐ ๋ชจ๋ Bean์ ChannelInterceptor๋ฅผ ๊ตฌํํด์ผ ํฉ๋๋ค.
@IntegrationConverter
@IntegrationConverter@IntegrationConverter ์ฃผ์์ converter, GenericConverter ๋๋ ConverterFactory ๋น์ integrationConversionService์ ํ๋ณด ๋ณํ๊ธฐ๋ก ํ์ํฉ๋๋ค.
Reference
Last updated
Was this helpful?