healchow commented on code in PR #5057:
URL: https://github.com/apache/inlong/pull/5057#discussion_r921751471
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/pulsar/PulsarClientService.java:
##########
@@ -402,19 +395,17 @@ public Map<String, List<TopicProducerInfo>>
getProducerInfoMap() {
private void destroyConnection() {
producerInfoMap.clear();
- if (pulsarClients != null) {
- for (PulsarClient pulsarClient : pulsarClients.values()) {
- try {
- pulsarClient.shutdown();
- } catch (PulsarClientException e) {
- logger.error("destroy pulsarClient error in PulsarSink,
PulsarClientException {}",
- e.getMessage());
- } catch (Exception e) {
- logger.error("destroy pulsarClient error in PulsarSink, ex
{}", e.getMessage());
- }
+ for (PulsarClient pulsarClient : pulsarClients.values()) {
+ try {
+ pulsarClient.shutdown();
+ } catch (PulsarClientException e) {
+ logger.error("destroy pulsarClient error in PulsarSink,
PulsarClientException {}",
Review Comment:
The error log should print all exception stacks.
For example:
```java
logger.error("destroy PulsarClient error in PulsarSink: ", e);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]