[bs-19] Add samples and CLI support for Spring Integration
$ cd spring-bootstrap-cli
$ export SPRING_HOME=target
$ src/main/scripts/spring run samples/integration.groovy
The big disadvantage at the moment is that there is no goo way to
detect Spring Integration in the AST (at least not as good as @Enable*).
So for now we are looking for @MessageEndpoint or a class name with
SpringIntegration in it.
[#48151147]
This commit is contained in:
15
spring-bootstrap-cli/samples/integration.groovy
Normal file
15
spring-bootstrap-cli/samples/integration.groovy
Normal file
@@ -0,0 +1,15 @@
|
||||
package org.test
|
||||
|
||||
@Component
|
||||
class SpringIntegrationExample implements CommandLineRunner {
|
||||
|
||||
def builder = new IntegrationBuilder()
|
||||
def flow = builder.messageFlow {
|
||||
transform {"Hello, $it!"}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
print flow.sendAndReceive("World")
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.test
|
||||
|
||||
@GrabResolver(name='spring-milestone', root='http://repo.springframework.org/milestone')
|
||||
@Grab("org.hsqldb:hsqldb-j5:2.0.0")
|
||||
@Configuration
|
||||
@EnableBatchProcessing
|
||||
@@ -33,6 +32,7 @@ class JobConfig {
|
||||
}
|
||||
}
|
||||
|
||||
import groovy.util.logging.Log
|
||||
import org.springframework.util.StringUtils
|
||||
import groovy.util.logging.Log
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.test
|
||||
|
||||
@GrabResolver(name='spring-snapshot', root='http://repo.springframework.org/snapshot')
|
||||
@Grab("org.springframework.bootstrap:spring-bootstrap-service:0.0.1-SNAPSHOT")
|
||||
|
||||
@Controller
|
||||
|
||||
Reference in New Issue
Block a user