Spring集成路由器配置

时间:2014-10-22 09:25:38

标签: java spring spring-integration

我正在努力寻找使用@Router注释的示例。如果我正确理解了javadoc:

@Service
public class AgentServiceImpl implements AgentService {

    @Override
    @Router(inputChannel = "agentLogin", defaultOutputChannel = "agentServiceResponse")
    public AgentLoginResponse login(AgentLoginRequest request) {

    }
}

在路由器的xml示例中,有一个服务激活器,我正试图弄清楚它是如何适应的。

1 个答案:

答案 0 :(得分:0)

其实你做错了。请参阅@Router JavaDocs:

* Indicates that a method is capable of resolving to a channel or channel name
* based on a message, message header(s), or both.

因此,目标login组件的router方法必须返回channel name或整个MessageChannel对象。