Skip to content

Commit

Permalink
fix ack callback detection order
Browse files Browse the repository at this point in the history
  • Loading branch information
Nephery committed Aug 28, 2024
1 parent 7579552 commit 7243476
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public void handleMessage(Message<?> message) throws MessagingException {
Throwable payload = errorMessage.getPayload();

Set<AcknowledgmentCallback> acknowledgmentCallbacks = new HashSet<>();

Optional.ofNullable(StaticMessageHeaderAccessor.getAcknowledgmentCallback(message))
.ifPresent(acknowledgmentCallbacks::add);

if (payload instanceof MessagingException messagingException) {
Optional.ofNullable(messagingException.getFailedMessage())
.map(m -> {
Expand All @@ -52,9 +56,6 @@ public void handleMessage(Message<?> message) throws MessagingException {
.map(StaticMessageHeaderAccessor::getAcknowledgmentCallback)
.ifPresent(acknowledgmentCallbacks::add);

Optional.ofNullable(StaticMessageHeaderAccessor.getAcknowledgmentCallback(message))
.ifPresent(acknowledgmentCallbacks::add);

if (StaticMessageHeaderAccessor.getSourceData(message) instanceof XMLMessage xmlMessage) {
info.append("source-jcsmp-message: ").append(xmlMessage.getMessageId()).append(", ");
}
Expand Down

0 comments on commit 7243476

Please sign in to comment.