Makky
Makky

Reputation: 17461

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.

Now lets say I get three records with department id (1 and 3)

I want to pause at DataSplitterTransformer() and route the message to "ValidFile" again

It will be two message 1 for department 1 and one for 3

Is that possible?

Upvotes: 0

Views: 83

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121282

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.

You can really route back to the ValidFile channel and also you can continue in the main flow using defaultOutputToParentFlow().

See their Javadocs for more info.

Upvotes: 1

Related Questions