2013-04-25 23:06:17 +08:00
|
|
|
package org.test
|
|
|
|
|
|
|
|
@Component
|
2013-04-26 19:02:49 +08:00
|
|
|
@EnableIntegrationPatterns
|
2013-04-25 23:06:17 +08:00
|
|
|
class SpringIntegrationExample implements CommandLineRunner {
|
|
|
|
|
2013-04-26 19:02:49 +08:00
|
|
|
@Bean
|
|
|
|
MessageFlow flow(ApplicationContext context) {
|
|
|
|
def builder = new IntegrationBuilder(context)
|
|
|
|
builder.messageFlow { transform {"Hello, $it!"} }
|
2013-04-25 23:06:17 +08:00
|
|
|
}
|
|
|
|
|
2013-04-26 19:02:49 +08:00
|
|
|
@Override
|
|
|
|
void run(String... args) {
|
|
|
|
print flow().sendAndReceive("World")
|
2013-04-25 23:06:17 +08:00
|
|
|
}
|
|
|
|
}
|