未验证 提交 800681aa 编写于 作者: L lipenghui 提交者: GitHub

Don't fail the health check request when try to delete previous subscription. (#7906)

上级 81202e14
......@@ -275,11 +275,16 @@ public class BrokersBase extends AdminResource {
// create non-partitioned topic manually and close the previous reader if present.
try {
pulsar().getBrokerService().getTopic(topic, true).get().ifPresent(t -> {
t.getSubscriptions().values().forEach(Subscription::deleteForcefully);
for (Subscription value : t.getSubscriptions().values()) {
try {
value.deleteForcefully();
} catch (Exception e) {
LOG.warn("Failed to delete previous subscription {} for health check", value.getName(), e);
}
}
});
} catch (Exception e) {
asyncResponse.resume(new RestException(e));
return;
LOG.warn("Failed to try to delete subscriptions for health check", e);
}
CompletableFuture<Producer<String>> producerFuture =
client.newProducer(Schema.STRING).topic(topic).createAsync();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册