You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/11/05 13:51:10 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #6411: [INLONG-6410][Manager] Ensure that the additional parameters of group and stream can be saved

healchow commented on code in PR #6411:
URL: https://github.com/apache/inlong/pull/6411#discussion_r1014638247


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupOperator4TubeMQ.java:
##########
@@ -61,15 +63,25 @@ public InlongTubeMQInfo getFromEntity(InlongGroupEntity entity) {
 
         InlongTubeMQInfo groupInfo = new InlongTubeMQInfo();
         CommonBeanUtils.copyProperties(entity, groupInfo);
-
+        if (StringUtils.isNotBlank(entity.getExtParams())) {
+            InlongTubeMQDTO dto = InlongTubeMQDTO.getFromJson(entity.getExtParams());
+            CommonBeanUtils.copyProperties(dto, groupInfo);
+        }
         // TODO get the cluster
         // groupInfo.setTubeMaster();
         return groupInfo;
     }
 
     @Override
     protected void setTargetEntity(InlongGroupRequest request, InlongGroupEntity targetEntity) {
-        LOGGER.info("do nothing for inlong group with TubeMQ");
+        InlongTubeMQRequest tubeMQRequest = (InlongTubeMQRequest) request;
+        try {
+            InlongTubeMQDTO dto = InlongTubeMQDTO.getFromRequest(tubeMQRequest);
+            targetEntity.setExtParams(objectMapper.writeValueAsString(dto));
+        } catch (Exception e) {
+            throw new BusinessException(ErrorCodeEnum.SOURCE_INFO_INCORRECT.getMessage() + ": " + e.getMessage());
+        }
+        LOGGER.info("success set entity for inlong group with TubeMQ");

Review Comment:
   Not necessary to add this info log, just remove it.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org