diff --git a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/PulsarSource.java b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/PulsarSource.java index 74b98eced72..64974d79942 100644 --- a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/PulsarSource.java +++ b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/PulsarSource.java @@ -130,16 +130,7 @@ private Consumer getConsumer() { LOGGER.info("Skip to reset consume"); } return consumer; - } catch (PulsarClientException e) { - if (consumer == null) { - try { - consumer.close(); - } catch (PulsarClientException ex) { - LOGGER.error("close consumer error", e); - } - } - LOGGER.error("get consumer error", e); - } catch (IllegalArgumentException e) { + } catch (PulsarClientException | IllegalArgumentException e) { if (consumer == null) { try { consumer.close();