Skip to content

Commit

Permalink
Merge pull request #622 from /issues/621-webflux-release
Browse files Browse the repository at this point in the history
Fix #621: Make sure to release response body when calling a callback
  • Loading branch information
petrdvorak authored Jun 29, 2021
2 parents adbd1b8 + 6d79d18 commit ad890a8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ public void notifyCallbackListeners(Long applicationId, ActivationRecordEntity a
if (response.statusCode().isError()) {
logger.warn("Callback failed, URL: {}, status code: {}", callbackUrlEntity.getCallbackUrl(), response.statusCode().toString());
}
// Release resources
response.releaseBody();
};
Consumer<Throwable> onError = error -> logger.warn("Callback failed, URL: {}, error: {}", callbackUrlEntity.getCallbackUrl(), error.getMessage());
restClient.postNonBlocking(callbackUrlEntity.getCallbackUrl(), callbackData, onSuccess, onError);
Expand Down

0 comments on commit ad890a8

Please sign in to comment.