简体   繁体   English

来自Transformer的Spring Integration路由消息

[英]Spring Integration route message from Transformer

I have intergration setup as 我有整合设置

    IntegrationFlows.from("ValidFile")
    .transform(
    Transformer(new FindTheDepartItbelongs()) //basically file has to match to some depoartment
    .transform(new FileParserTransformer()
.transform(new DataSplitterTransformer()
    .transformer(new CustomerTransformer()
    .handle (o -> {})

As you see the DataSplitterTransformer () basically I have to group the data for example Department ID. 如您所见, DataSplitterTransformer ()基本上是将数据分组的,例如部门ID。

Now lets say I get three records with department id (1 and 3) 现在说我得到了三个部门编号分别为1和3的记录

I want to pause at DataSplitterTransformer() and route the message to "ValidFile" again 我想在DataSplitterTransformer()处暂停并将消息再次路由到“ ValidFile”

It will be two message 1 for department 1 and one for 3 这将是部门1的两条消息1和部门3的一条消息

Is that possible? 那可能吗?

Your configuration is not clear with such an explanation. 这样的解释不清楚您的配置。 Sounds like you are missing the fact that there are .split() for producing several output from a single message and also a .route() to decide where to send every message according selector logic. 听起来您似乎缺少这样一个事实:既有.split()用于从一条消息生成多个输出, .route()根据选择器逻辑来决定将每条消息发送到何处。

You can really route back to the ValidFile channel and also you can continue in the main flow using defaultOutputToParentFlow() . 您可以真正地路由回到ValidFile通道,也可以使用defaultOutputToParentFlow()在主流中继续。

See their Javadocs for more info. 有关更多信息,请参见其Javadocs。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM