Java Container Configuration for Spring Integration Definition

I previously used an XML based configuration for my Spring application.

Now I want to use the container configuration ONLY in Java using @ Bean, @Configuration, etc.

How do I convert these two parts of XML configurations to Java based configuration?

<outbound-channel-adapter channel="emailChannel" ref="messageHandler"> <poller> <interval-trigger interval="60000"/> </poller> </outbound-channel-adapter> <tx:annotation-driven transaction-manager="transactionManager"/> 
+4
source share
1 answer

Unlike the simple <bean /> syntax for Spring Beans, which can easily be replaced with @Bean java configuration, Spring DSL XML Integration provides a rich abstraction over Spring integration components.

To replace

 <outbound-channel-adapter/> 

above, you will need to dig into NamespaceHandlers and XML parsers to determine the equivalent beans set needed to determine the @Beans equivalent. Context disks are created that are beans (for example, whether emailChannel is a subscription or an infected channel).

For <tx: annotation-driven />, you can use the new Spring 3.1 @Enable notes ......

http://blog.springsource.org/2011/06/10/spring-3-1-m2-configuration-enhancements/

http://static.springsource.org/spring/docs/3.1.1.RELEASE/spring-framework-reference/html/new-in-3.1.html

+4
source

Source: https://habr.com/ru/post/1398757/


All Articles