pocozh commented on a change in pull request #2670:
URL: https://github.com/apache/incubator-inlong/pull/2670#discussion_r813552095
##########
File path:
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/pulsar/PulsarClientService.java
##########
@@ -299,6 +300,65 @@ private void destroyConnection() {
logger.debug("closed meta producer");
}
+ /**
+ * close pulsarClients(the related url is removed); start pulsarClients
for new url, and create producers for them
+ *
+ * @param callBack
+ * @param needToClose url-token map
+ * @param needToStart url-token map
+ * @param topicSet for new pulsarClient, create these topics' producers
+ */
+ public void updatePulsarClients(CreatePulsarClientCallBack callBack,
Map<String, String> needToClose,
+ Map<String, String> needToStart,
Set<String> topicSet) {
+ // close
+ for (String url : needToClose.keySet()) {
+ PulsarClient pulsarClient = pulsarClients.get(url);
+ if (pulsarClient != null) {
+ try {
+ pulsarClient.shutdown();
Review comment:
done
--
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]