flowers-59f commented on code in PR #12107:
URL: https://github.com/apache/inlong/pull/12107#discussion_r3231253752


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java:
##########
@@ -215,7 +215,27 @@ public String save(InlongGroupRequest request, String 
operator) {
         if (request.getEnableZookeeper() == null) {
             request.setEnableZookeeper(enableZookeeper ? 
InlongConstants.ENABLE_ZK : InlongConstants.DISABLE_ZK);
         }
-        InlongGroupOperator instance = 
groupOperatorFactory.getInstance(request.getMqType());
+
+        if (request.getEnableCreateResource() == null) {
+            
request.setEnableCreateResource(InlongConstants.ENABLE_CREATE_RESOURCE);
+        }
+
+        if (request.getInlongGroupMode() == null) {
+            request.setInlongGroupMode(InlongConstants.STANDARD_MODE);

Review Comment:
   In QueueResourceListener.listen()
   ```java
           if 
(InlongConstants.DATASYNC_REALTIME_MODE.equals(groupInfo.getInlongGroupMode())
                   || 
InlongConstants.DATASYNC_OFFLINE_MODE.equals(groupInfo.getInlongGroupMode())) {
               log.warn("skip to execute QueueResourceListener as sync mode {} 
(1 for realtime sync, 2 for offline sync) "
                       + "for groupId={}", groupInfo.getInlongGroupMode(), 
groupId);
               if (GroupOperateType.INIT.equals(operateType)) {
                   this.createQueueForStreams(groupInfo, 
groupProcessForm.getStreamInfos(), operator);
               }
               return ListenerResult.success("skip - disable create mq resource 
for sync mode");
           }
   
           if 
(InlongConstants.DISABLE_CREATE_RESOURCE.equals(groupInfo.getEnableCreateResource()))
 {
               log.warn("skip to execute QueueResourceListener as disable 
create resource for groupId={}", groupId);
               return ListenerResult.success("skip - disable create resource");
           }
   ```
   In other modes, the creation/deletion of MQ resources will be skipped, so we 
only need to check for the existence of the corresponding MQ in specific modes. 
But, under this save link, the EnableCreateResource and InlongGroupMode passed 
in the request do not have values, so I set them according to the default 
values and made a check. Since there are other places that call this function, 
they might have set the corresponding values, and in those cases, validation 
might not be required.
   
   This is my idea. Please take a look and see if there are any issues and let 
me know how I can improve.Thank you very much.



-- 
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]

Reply via email to