dockerzhang commented on code in PR #4479:
URL: https://github.com/apache/incubator-inlong/pull/4479#discussion_r886679476
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarGroupTaskListener.java:
##########
@@ -94,29 +95,29 @@ public ListenerResult listen(WorkflowContext context)
throws WorkflowListenerExc
topicBean.setNamespace(namespace);
String topic = streamEntity.getMqResource();
topicBean.setTopicName(topic);
- List<String> pulsarClusters =
PulsarUtils.getPulsarClusters(globalPulsarAdmin);
-
- // Create a subscription in the Pulsar cluster (cross-region),
you need to ensure that the Topic exists
- for (String cluster : pulsarClusters) {
- String serviceUrl =
PulsarUtils.getServiceUrl(globalPulsarAdmin, cluster);
- PulsarClusterInfo pulsarClusterInfo =
PulsarClusterInfo.builder()
-
.token(globalCluster.getToken()).adminUrl(serviceUrl).build();
- try (PulsarAdmin pulsarAdmin =
PulsarUtils.getPulsarAdmin(pulsarClusterInfo)) {
- boolean exist =
pulsarOptService.topicIsExists(pulsarAdmin, tenant, namespace, topic);
-
- if (!exist) {
- String topicFull = tenant + "/" + namespace + "/"
+ topic;
- log.error("topic={} not exists in {}", topicFull,
serviceUrl);
- throw new WorkflowListenerException("topic=" +
topicFull + " not exists in " + serviceUrl);
- }
-
- // Consumer naming rules:
sortAppName_topicName_consumer_group
- String subscription = clusterBean.getAppName() + "_" +
topic + "_consumer_group";
- pulsarOptService.createSubscription(pulsarAdmin,
topicBean, subscription);
-
- // Insert the consumption data into the consumption
table
- consumptionService.saveSortConsumption(groupInfo,
topic, subscription);
+
+ // Create a subscription in the Pulsar cluster you need to
ensure that the Topic exists
+ try {
+ boolean exist =
pulsarOptService.topicIsExists(globalPulsarAdmin, tenant, namespace, topic);
Review Comment:
if we remove the multi clusters, I think we should remove all `global`
prefixes for all params.
--
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]