Spring integration spring集成java dsl频道创建
doc说:如果没有具有此名称的bean,那么新的directchannelbean将在上下文启动时创建Spring integration spring集成java dsl频道创建,spring-integration,Spring Integration,doc说:如果没有具有此名称的bean,那么新的directchannelbean将在上下文启动时创建 @MessagingGateway public interface Responder { @Gateway(requestChannel = "request.input") String respond(String request); } @Bean public IntegrationFlow doRespons
@MessagingGateway
public interface Responder {
@Gateway(requestChannel = "request.input")
String respond(String request);
}
@Bean
public IntegrationFlow doResponse(){
return IntegrationFlows
.from("request.input")
.transform("payload")
.get();
}
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {IntegrationConfiguration.class})
public class GatewayTests {
@Autowired Responder responder;
@Test
public void test(){
responder.respond("request");
}
}
这导致:没有定义名为“request.input”的bean
我是否遗漏了触发频道创建的内容
弹簧靴:1.1.9.1释放
spring集成java dsl:1.0.0.0版本
spring integration:4.0.4.发行版您应该确保spring integration infrastructure已打开:
@Configuration
类上的@EnableIntegration
,或者如果使用spring Boot,请打开@EnableAutoConfiguration
从另一方面看,并非所有的自动频道功能都适用于Spring Integration 4.0.x
有了这一点,您总是可以通过显式的MessageChannel
@Bean
来克服这个问题。好吧,我的错误是:IntegrationComponentScan没有为MessagingGateway创建通道好吧,我完全迷路了。IntegrationFlow知道在哪里调用响应程序?