Skip to content

Commit

Permalink
Direct Messaging: Publish failed listener to track failures and updat…
Browse files Browse the repository at this point in the history
…e health status
  • Loading branch information
SravanThotakura05 committed Jul 12, 2024
1 parent 84fe6e5 commit 318f84c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ private Uni<Object> publishMessage(DirectMessagePublisher publisher, Message<?>
// });
// } else {
publisher.publish(outboundMessage, topic.get());
publisher.setPublishFailureListener(failedPublishEvent -> {
PubSubPlusClientException exception = failedPublishEvent.getException();
if (exception != null) {
isPublishFailed = true;
e.fail(exception);
} else {
publishedMessagesTracker.decrement();
e.complete(null);
}
});
publishedMessagesTracker.decrement();
e.complete(null);
// }
Expand Down

0 comments on commit 318f84c

Please sign in to comment.