[INLONG-12106][Manager] Add relevant MQ cluster checks#12107
[INLONG-12106][Manager] Add relevant MQ cluster checks#12107flowers-59f wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| if (request.getInlongGroupMode() == null) { | ||
| request.setInlongGroupMode(InlongConstants.STANDARD_MODE); |
There was a problem hiding this comment.
There is no need to set a default value here, as the create table statement for the inlong_group table has already set a default value
There was a problem hiding this comment.
In QueueResourceListener.listen()
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.
| } | ||
|
|
||
| String mqType = request.getMqType(); | ||
| if (InlongConstants.STANDARD_MODE.equals(request.getInlongGroupMode()) |
There was a problem hiding this comment.
When saving the group, no inlong_cluster_tag was assigned, so there is no need for judgment here.
Fixes #12106
Modifications
Before saving the connection, verify if there is a corresponding cluster
The reason for conducting the state judgment first is that some modes do not require the creation or deletion of MQ resources.
Refer to QueueResourceListener.listen(...)
Verifying this change
I didn't write unit tests, but conducted a front-end and back-end integration test.
The results are as follows:
Adding data access when there is no corresponding MQ cluster
After creating the corresponding MQ cluster



Success in creation
And it will not affect the creation of data flow groups during data synchronization.
Documentation