Skip to content

Commit

Permalink
Apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
codelipenghui committed Jan 12, 2022
1 parent 222d1f7 commit 2524961
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1518,21 +1518,22 @@ private void internalDeleteSubscriptionForNonPartitionedTopic(AsyncResponse asyn
log.info("[{}][{}] Deleted subscription {}", clientAppId(), topicName, subName);
asyncResponse.resume(Response.noContent().build());
}).exceptionally(e -> {
if (e.getCause() instanceof SubscriptionBusyException) {
Throwable cause = e.getCause();
if (cause instanceof SubscriptionBusyException) {
log.error("[{}] Failed to delete subscription {} from topic {}", clientAppId(), subName,
topicName, e);
topicName, cause);
asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED,
"Subscription has active connected consumers"));
} else if (e instanceof WebApplicationException) {
if (log.isDebugEnabled() && ((WebApplicationException) e).getResponse().getStatus()
} else if (cause instanceof WebApplicationException) {
if (log.isDebugEnabled() && ((WebApplicationException) cause).getResponse().getStatus()
== Status.TEMPORARY_REDIRECT.getStatusCode()) {
log.debug("[{}] Failed to delete subscription from topic {}, redirecting to other brokers.",
clientAppId(), topicName, e);
clientAppId(), topicName, cause);
}
asyncResponse.resume(e);
asyncResponse.resume(cause);
} else {
log.error("[{}] Failed to delete subscription {} {}", clientAppId(), topicName, subName, e);
asyncResponse.resume(new RestException(e));
log.error("[{}] Failed to delete subscription {} {}", clientAppId(), topicName, subName, cause);
asyncResponse.resume(new RestException(cause));
}
return null;
});
Expand Down

0 comments on commit 2524961

Please sign in to comment.