spring-boot/spring-bootstrap-cli/samples/integration.groovy
Dave Syer 10c333ea10 [bs-73] Tweak algorithm for detecting anonymous classes
@Bean definitions in Groovy that contain closures have the bean name in
the class name.  Ugh.  Added regex match to catch that.

[#48718891]
2013-04-26 12:02:49 +01:00

18 lines
361 B
Groovy

package org.test
@Component
@EnableIntegrationPatterns
class SpringIntegrationExample implements CommandLineRunner {
@Bean
MessageFlow flow(ApplicationContext context) {
def builder = new IntegrationBuilder(context)
builder.messageFlow { transform {"Hello, $it!"} }
}
@Override
void run(String... args) {
print flow().sendAndReceive("World")
}
}