You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
436 B
Groovy
26 lines
436 B
Groovy
11 years ago
|
package org.test
|
||
|
|
||
|
@Component
|
||
|
@EnableIntegrationPatterns
|
||
|
class SpringIntegrationExample implements CommandLineRunner {
|
||
|
|
||
|
@Bean
|
||
|
DirectChannel input() {
|
||
|
new DirectChannel();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
void run(String... args) {
|
||
|
print new MessagingTemplate(input()).convertSendAndReceive("World")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@MessageEndpoint
|
||
|
class HelloTransformer {
|
||
|
|
||
|
@Transformer(inputChannel="input")
|
||
|
String transform(String payload) {
|
||
|
"Hello, ${payload}"
|
||
|
}
|
||
|
|
||
|
}
|