Skip to content

Auto-completion of the Message group and race condition between the Reaper and discard-channel [INT-2014] #5999

@spring-operator

Description

@spring-operator

Oleg Zhurakousky opened INT-2014 and commented

MessageGroup is considered complete if it has accumulated the amount of messages specified by the sequenceSize. However CorrelatingMessageHandler can still return 'false' on canRelease() call if custom release strategy is provided. For example, i may want to batch up messages in groups (as the use case in the forum) of 5 while my sequence size is 7. This means that the first batch of 5 messages will be released as soon as MessageGroup has 5 messages. The other two Messages will complete the MessageGroup and based on the current code in CorrelatingMessageHandler these two Messages will be sent to a discard channel unless Reaper gets to them first. So its basically one big race condition with unpredictable results.
This goes back to the mutual exclusivity. If send-partial-result-on-expiry is set to 'true', then CorrelatingMessageHandler should assume that Reaper has control over the MessageGroup and not send messages to the discardChannel


 else if (!sendPartialResultOnExpiry && group.isComplete())  instead of what we have now else if (group.isComplete())

Affects: 2.0.5

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions