Skip to content

Commit

Permalink
merge: #9966
Browse files Browse the repository at this point in the history
9966: Fix NPE on sendCorrelateCommand() side-effect r=remcowesterhoud a=remcowesterhoud

## Description

<!-- Please explain the changes you made here. -->
With the engine abstraction topic the response writer is already getting flushed in the `executeSideEffects()` method of the `ProcessingStateMachine`. Flushing a second time here causes NullPointerExceptions.


## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #9860



Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
  • Loading branch information
zeebe-bors-camunda[bot] and remcowesterhoud committed Aug 4, 2022
2 parents 2c1a9d6 + cea3418 commit e243569
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,15 @@ private void correlateToMessageStartEvents(final MessageRecord messageRecord) {
}

private boolean sendCorrelateCommand() {

final var success =
correlatingSubscriptions.visitSubscriptions(
subscription ->
commandSender.correlateProcessMessageSubscription(
subscription.getProcessInstanceKey(),
subscription.getElementInstanceKey(),
subscription.getBpmnProcessId(),
messageRecord.getNameBuffer(),
messageKey,
messageRecord.getVariablesBuffer(),
messageRecord.getCorrelationKeyBuffer()));

return success && responseWriter.flush();
return correlatingSubscriptions.visitSubscriptions(
subscription ->
commandSender.correlateProcessMessageSubscription(
subscription.getProcessInstanceKey(),
subscription.getElementInstanceKey(),
subscription.getBpmnProcessId(),
messageRecord.getNameBuffer(),
messageKey,
messageRecord.getVariablesBuffer(),
messageRecord.getCorrelationKeyBuffer()));
}
}

0 comments on commit e243569

Please sign in to comment.