Relocate projects to spring-boot-project
Move projects to better reflect the way that Spring Boot is released. The following projects are under `spring-boot-project`: - `spring-boot` - `spring-boot-autoconfigure` - `spring-boot-tools` - `spring-boot-starters` - `spring-boot-actuator` - `spring-boot-actuator-autoconfigure` - `spring-boot-test` - `spring-boot-test-autoconfigure` - `spring-boot-devtools` - `spring-boot-cli` - `spring-boot-docs` See gh-9316
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package org.test
|
||||
|
||||
@Configuration
|
||||
@EnableIntegration
|
||||
class SpringIntegrationExample implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Bean
|
||||
DirectChannel input() {
|
||||
new DirectChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
void run(String... args) {
|
||||
println()
|
||||
println '>>>> ' + new MessagingTemplate(input()).convertSendAndReceive("World", String) + ' <<<<'
|
||||
println()
|
||||
/*
|
||||
* Since this is a simple application that we want to exit right away,
|
||||
* close the context. For an active integration application, with pollers
|
||||
* etc, you can either suspend the main thread here (e.g. with System.in.read()),
|
||||
* or exit the run() method without closing the context, and stop the
|
||||
* application later using some other technique (kill, JMX etc).
|
||||
*/
|
||||
context.close()
|
||||
}
|
||||
}
|
||||
|
||||
@MessageEndpoint
|
||||
class HelloTransformer {
|
||||
|
||||
@Transformer(inputChannel="input")
|
||||
String transform(String payload) {
|
||||
"Hello, ${payload}"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user