Skip to content

Commit

Permalink
Skip adding aggregates when the flow is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
SanojPunchihewa committed Dec 6, 2024
1 parent 0ccc7e5 commit 94b201f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public Aggregate(SynapseEnvironment synEnv, String corelation, long timeoutMilli
*/
public synchronized boolean addMessage(MessageContext synCtx) {
if (maxCount <= 0 || (maxCount > 0 && messages.size() < maxCount)) {
if (messages == null) {
return false;
}
messages.add(synCtx);
return true;
} else {
Expand Down

0 comments on commit 94b201f

Please sign in to comment.