[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]pull/1/merge
parent
ec351e5f7d
commit
10c333ea10
@ -1,15 +1,17 @@
|
|||||||
package org.test
|
package org.test
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@EnableIntegrationPatterns
|
||||||
class SpringIntegrationExample implements CommandLineRunner {
|
class SpringIntegrationExample implements CommandLineRunner {
|
||||||
|
|
||||||
def builder = new IntegrationBuilder()
|
@Bean
|
||||||
def flow = builder.messageFlow {
|
MessageFlow flow(ApplicationContext context) {
|
||||||
transform {"Hello, $it!"}
|
def builder = new IntegrationBuilder(context)
|
||||||
|
builder.messageFlow { transform {"Hello, $it!"} }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) {
|
void run(String... args) {
|
||||||
print flow.sendAndReceive("World")
|
print flow().sendAndReceive("World")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package org.test
|
||||||
|
|
||||||
|
@Grab("org.springframework.bootstrap:spring-bootstrap-service:0.0.1-SNAPSHOT")
|
||||||
|
@Grab("org.springframework.integration:spring-integration-dsl-groovy-amqp:1.0.0.M1")
|
||||||
|
|
||||||
|
@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")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue