2

我需要从多个来源定义多个流,然后将它们合并为一个。在阅读了 Spring XD 的整个文档之后,我没有找到任何可以进行连接的预定义模块(例如基于滑动窗口)。有什么解决办法吗?谢谢。

4

1 回答 1

5

It is possible to do this with named channels. For example you can create several streams that output to a queue, and a "join" stream which uses the queue as a source:

xd:>stream create s1 --definition "http --port=9000 > queue:join" --deploy
xd:>stream create s2 --definition "http --port=9001 > queue:join" --deploy
xd:>stream create join --definition "queue:join > file" --deploy

The above will write content posted to either http://somehost.example.com:9000 or port http://somehost.example.com:9001 to a file.

于 2014-08-04T18:27:58.073 回答