[性能优化](master): 更新了一些逻辑

更新大坝环境配置及集群模式添加
master
土豆兄弟 3 years ago
parent b678d6729f
commit a0a1d52195

@ -72,10 +72,15 @@ public class SendBigDataTask {
*/
private static final int FINISH_SEND_TAG = 1;
/**
*
*/
public static final String CLUSTER_TAG = "999";
/**
* ,
*/
public static final String BASE_URL_CHAR_NUMBER = "12345678910";
public static final String BASE_URL_CHAR_NUMBER = "1234567891011";
/**
* url
@ -89,6 +94,12 @@ public class SendBigDataTask {
@Value(value = "${req.db.host}")
private String host;
/**
*
*/
@Value(value = "${req.db.cluster}")
private String cluster;
/**
*
*/
@ -448,17 +459,22 @@ public class SendBigDataTask {
}
private String preSendReqAddress(String tag) {
StringBuilder builder = new StringBuilder();
// 集群模式
if(CLUSTER_TAG.equalsIgnoreCase(tag)){
return cluster;
}
// 处理环境选择问题, 只接受单个 a, b, c 中的任意一个输入,如果不输入就进行随机返回
tag = (StringUtils.isNotBlank(tag) && StringUtils.countMatches(BASE_URL_CHAR_NUMBER, tag.trim()) >= 1)?
tag.trim(): String.valueOf(RandomUtil.randomChar(BASE_URL_CHAR_NUMBER));
// 拼接成需要的URL进行返回
StringBuilder builder = new StringBuilder();
builder.append(host)
.append(tag)
.append(url);
// 返回拼接结果
return builder.toString();
}
//发给文件系统短信内容
private void sendSmsContent(RemoteRecord resource,TbSendSmsContentDto tbSendSmsContentDto){
// 组装成JSON

@ -26,7 +26,7 @@ public class TaskRecordSendVO implements Serializable {
private Long taskId;
/**
* , 0 ,1-5
* , 0 ,1-11 999
*/
private String addressTag;

@ -53,10 +53,15 @@ public class SendRecordTask {
*/
private static final int FINISH_SEND_TAG = 1;
/**
*
*/
public static final String CLUSTER_TAG = "999";
/**
* ,
*/
public static final String BASE_URL_CHAR_NUMBER = "12345678910";
public static final String BASE_URL_CHAR_NUMBER = "1234567891011";
/**
* url
@ -70,6 +75,12 @@ public class SendRecordTask {
@Value(value = "${req.db.host}")
private String host;
/**
*
*/
@Value(value = "${req.db.cluster}")
private String cluster;
@Autowired
private TaskRecordService taskRecordService;
@ -189,11 +200,15 @@ public class SendRecordTask {
}
private String preSendReqAddress(String tag) {
StringBuilder builder = new StringBuilder();
// 处理环境选择问题, 只接受单个 a, b, c 中的任意一个输入,如果不输入就进行随机返回
// 集群模式
if(CLUSTER_TAG.equalsIgnoreCase(tag)){
return cluster;
}
// 处理环境选择问题, 通配集群模式和非集群模式
tag = (StringUtils.isNotBlank(tag) && StringUtils.countMatches(BASE_URL_CHAR_NUMBER, tag.trim()) >= 1)?
tag.trim(): String.valueOf(RandomUtil.randomChar(BASE_URL_CHAR_NUMBER));
// 拼接成需要的URL进行返回
StringBuilder builder = new StringBuilder();
builder.append(host)
.append(tag)
.append(url);

@ -175,6 +175,7 @@ req:
# 设置给大坝回传号码的地址
host: http://api.hzdaba.cn/aibot
url: /api/activity/addclient
cluster: http://ai.hzdaba.cn/api/activity/addclient
# 线程池的相关配置
produce:
task:

@ -130,6 +130,7 @@ req:
# 设置给大坝回传号码的地址
host: http://api.hzdaba.cn/aibot
url: /api/activity/addclient
cluster: http://ai.hzdaba.cn/api/activity/addclient
# 线程池的相关配置
produce:
task:

@ -117,6 +117,7 @@ req:
# 设置给大坝回传号码的地址
host: http://api.hzdaba.cn/aibot
url: /api/activity/addclient
cluster: http://ai.hzdaba.cn/api/activity/addclient
# 线程池的相关配置
produce:
task:

@ -172,6 +172,7 @@ req:
# 设置给大坝回传号码的地址
host: http://api.hzdaba.cn/aibot
url: /api/activity/addclient
cluster: http://ai.hzdaba.cn/api/activity/addclient
# 线程池的相关配置
produce:
task:

@ -176,6 +176,7 @@ req:
# 设置给大坝回传号码的地址
host: http://api.hzdaba.cn/aibot
url: /api/activity/addclient
cluster: http://ai.hzdaba.cn/api/activity/addclient
# 线程池的相关配置
produce:
task:

@ -185,4 +185,10 @@ public class TempTest {
System.out.println(FileUtil.del(dirPath));
}
public static final String BASE_URL_CHAR_NUMBER = "1234567891011";
@Test
public void test(){
System.out.println(StringUtils.countMatches(BASE_URL_CHAR_NUMBER, "13"));
}
}

@ -129,7 +129,7 @@
<!-- 生成代码时候进行注释 -->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<groupId>org.apache.shardingSphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.0.0-RC1</version>
</dependency>

Loading…
Cancel
Save