Source:
protected void handleMessageInternal(Message<?> message) throws Exception { Object correlationKey = this.correlationStrategy.getCorrelationKey(message); Assert.state(correlationKey != null, "Null correlation not allowed. Maybe the CorrelationStrategy is failing?"); if (this.logger.isDebugEnabled()) { this.logger.debug("Handling message with correlationKey [" + correlationKey + "]: " + message); } UUID groupIdUuid = UUIDConverter.getUUID(correlationKey); Lock lock = this.lockRegistry.obtain(groupIdUuid.toString()); boolean noOutput = true; lock.lockInterruptibly(); try { ScheduledFuture<?> scheduledFuture = this.expireGroupScheduledFutures.remove(groupIdUuid); if (scheduledFuture != null) { boolean canceled = scheduledFuture.cancel(true); if (canceled && this.logger.isDebugEnabled()) { this.logger.debug("Cancel 'ScheduledFuture' for MessageGroup with Correlation Key [ " + correlationKey + "]."); } } MessageGroup messageGroup = this.messageStore.getMessageGroup(correlationKey); if (this.sequenceAware) { messageGroup = new SequenceAwareMessageGroup(messageGroup); } if (!messageGroup.isComplete() && messageGroup.canAdd(message)) { if (this.logger.isTraceEnabled()) { this.logger.trace("Adding message to group [ " + messageGroup + "]"); } messageGroup = this.store(correlationKey, message); if (this.releaseStrategy.canRelease(messageGroup)) { Collection<Message<?>> completedMessages = null; try { completedMessages = completeGroup(message, correlationKey, messageGroup, lock); noOutput = false; } finally { afterRelease(messageGroup, completedMessages); } if (!isExpireGroupsUponCompletion() && this.minimumTimeoutForEmptyGroups > 0) { removeEmptyGroupAfterTimeout(messageGroup, this.minimumTimeoutForEmptyGroups); } } else { scheduleGroupToForceComplete(messageGroup); } } else { discardMessage(message, lock); noOutput = false; } } finally { if (noOutput || !this.releaseLockBeforeSend) { lock.unlock(); } } }

Target:
protected void handleMessageInternal(Message<?> message) throws Exception { Object correlationKey = this.correlationStrategy.getCorrelationKey(message); Assert.state(correlationKey != null, "Null correlation not allowed. Maybe the CorrelationStrategy is failing?"); if (this.logger.isDebugEnabled()) { this.logger.debug("Handling message with correlationKey [" + correlationKey + "]: " + message); } UUID groupIdUuid = UUIDConverter.getUUID(correlationKey); Lock lock = this.lockRegistry.obtain(groupIdUuid.toString()); boolean noOutput = true; lock.lockInterruptibly(); try { ScheduledFuture<?> scheduledFuture = this.expireGroupScheduledFutures.remove(groupIdUuid); if (scheduledFuture != null) { boolean canceled = scheduledFuture.cancel(true); if (canceled && this.logger.isDebugEnabled()) { this.logger.debug("Cancel 'ScheduledFuture' for MessageGroup with Correlation Key [ " + correlationKey + "]."); } } MessageGroup messageGroup = this.messageStore.getMessageGroup(correlationKey); if (this.sequenceAware) { messageGroup = new SequenceAwareMessageGroup(messageGroup); } if (!messageGroup.isComplete() && messageGroup.canAdd(message)) { if (this.logger.isTraceEnabled()) { this.logger.trace("Adding message to group [ " + messageGroup + "]"); } messageGroup = this.store(correlationKey, message); if (this.releaseStrategy.canRelease(messageGroup)) { Collection<Message<?>> completedMessages = null; try { noOutput = false; completedMessages = completeGroup(message, correlationKey, messageGroup, lock); } finally { afterRelease(messageGroup, completedMessages); } if (!isExpireGroupsUponCompletion() && this.minimumTimeoutForEmptyGroups > 0) { removeEmptyGroupAfterTimeout(messageGroup, this.minimumTimeoutForEmptyGroups); } } else { scheduleGroupToForceComplete(messageGroup); } } else { noOutput = false; discardMessage(message, lock); } } finally { if (noOutput || !this.releaseLockBeforeSend) { lock.unlock(); } } }