Make sure integration still works in CLI
This commit is contained in:
26
spring-boot-cli/samples/integration.groovy
Normal file
26
spring-boot-cli/samples/integration.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
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}"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user