Skip to content

Commit

Permalink
[ISSUE #4038]Optimize eventmesh-openconnect log print (#4039)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm authored May 30, 2023
1 parent 3092643 commit dc79036
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public void start() {
try {
sink.start();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
log.error("sink worker[{}] start fail", sink.name(), e);
return;
}
eventMeshTCPClient.subscribe(config.getPubSubConfig().getSubject(), SubscriptionMode.CLUSTERING,
SubscriptionType.ASYNC);
Expand All @@ -105,19 +105,18 @@ public void stop() {
eventMeshTCPClient.unsubscribe();
eventMeshTCPClient.close();
} catch (Exception e) {
e.printStackTrace();
log.error("event mesh client close", e);
}
try {
sink.stop();
} catch (Exception e) {
log.error("sink destroy error", e);
}

log.info("source worker stopped");
}

static class EventHandler implements ReceiveMsgHook<CloudEvent> {

private final Sink sink;

public EventHandler(Sink sink) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ public void start() {
eventMeshTCPClient.publish(event, 3000);
}
}
log.info("source worker[{}] started", source.name());
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
log.error("source worker[{}] start fail", source.name(), e);
}
log.info("source worker started");
}

private CloudEvent convertRecordToEvent(ConnectRecord connectRecord) {
Expand Down

0 comments on commit dc79036

Please sign in to comment.