spring-projects / spring-integration-samples

You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.
http://www.springsource.org/spring-integration
2.32k stars 2.55k forks source link

How to set up apply-sequence=true through xml configuration #338

Closed augnil closed 1 year ago

augnil commented 1 year ago

In case of Distribution scenario, if we want to implement default correlation strategy for aggregator. It says we need to specify apply-sequence=true but how do we add apply-sequence attribute in gatherer element. I am not able to find such attribute to specify apply-sequence in Distribution scenario but can find in aution (publishsubscribe channel element) can you please suggest here?

Also, i was trying to run Junit test "https://github.com/spring-projects/spring-integration/blob/ece3198ee939ba1ca7334f391d956bac9f0d4aa5/spring-integration-core/src/test/java/org/springframework/integration/scattergather/config/ScatterGatherTests.java#L75" using configuration provided in above location i am getting below error "No reply produced by handler" and its requirerReply property is set to true" ..Any suggestion to address this issue?

artembilan commented 1 year ago

See documentation: https://docs.spring.io/spring-integration/docs/current/reference/html/message-routing.html#distribution

The applySequence=true is required only for plain Java configuration based on the ScatterGatherHandler(MessageHandler scatterer, MessageHandler gatherer) constructor configuration since the framework cannot mutate externally provided components. For convenience, the XML and Java DSL for Scatter-Gather sets applySequence to true starting with version 6.0.

For an older version with an XML configuration it is just enough to have it like this:

    <int:scatter-gather>
        <int:scatterer apply-sequence="true"/>
    </int:scatter-gather>

It is not a gatherer feature, please, read that doc and make yourself familiar with terminology.

That test doesn't fail for us for years. We need to know more what you are doing. Probably this is going to be already out of this project scope. Let's see if you can raise a StackOverflow question with much more info what the problem you have and what you'd like to achieve.

For now it is a bit confusing: you are missing an obvious property on <scatterer>, you show the test which does not fail 🤷

Closing as Invalid - has nothing to do with this samples project.