我创建了一个headervaluerouter bean
@Bean
public HeaderValueRouter router (){
HeaderValueRouter router = new HeaderValueRouter("received");
router.setChannelMapping("response","replyCh");
router.setChannelMapping("request","requestCh");
//router.setManagedName();
return router;
}
但路由器无法设置输入通道?
答案 0 :(得分:1)
路由器是MessageHandler
实现。它的责任就是处理信息。输入通道是消费者端点逻辑的一部分。为此,您可以使用@ServiceActivator
或@Router
标记此路由器bean。您可以在参考手册中找到更多信息:http://docs.spring.io/spring-integration/docs/4.3.4.RELEASE/reference/html/overview.html#programming-tips