From 0b3a3fa08869de01b34e81776c44ed5471e8215c Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Thu, 8 Jun 2023 19:03:15 +0800 Subject: [PATCH 1/8] =?UTF-8?q?Fixes=20Email=20=E6=AD=A3=E5=88=99=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../austin/service/api/impl/action/AfterParamCheckAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AfterParamCheckAction.java b/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AfterParamCheckAction.java index 9dcd0e6..5bc4430 100644 --- a/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AfterParamCheckAction.java +++ b/austin-service-api-impl/src/main/java/com/java3y/austin/service/api/impl/action/AfterParamCheckAction.java @@ -30,7 +30,7 @@ import java.util.stream.Collectors; public class AfterParamCheckAction implements BusinessProcess { public static final String PHONE_REGEX_EXP = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[0-9])|(18[0-9])|(19[1,8,9]))\\d{8}$"; - public static final String EMAIL_REGEX_EXP = "^[A-Za-z0-9-_\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"; + public static final String EMAIL_REGEX_EXP = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"; public static final HashMap CHANNEL_REGEX_EXP = new HashMap<>(); From 786383b446a7f5901b2f559ed55ac7206f3fba8c Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Thu, 8 Jun 2023 19:03:57 +0800 Subject: [PATCH 2/8] =?UTF-8?q?Fixes=20=E5=AE=9A=E6=97=B6=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=BF=9D=E5=AD=98=E5=90=8E,=20CronTask=20=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../austin/web/service/impl/MessageTemplateServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/austin-web/src/main/java/com/java3y/austin/web/service/impl/MessageTemplateServiceImpl.java b/austin-web/src/main/java/com/java3y/austin/web/service/impl/MessageTemplateServiceImpl.java index 15cacb8..c156fd8 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/service/impl/MessageTemplateServiceImpl.java +++ b/austin-web/src/main/java/com/java3y/austin/web/service/impl/MessageTemplateServiceImpl.java @@ -182,6 +182,12 @@ public class MessageTemplateServiceImpl implements MessageTemplateService { messageTemplate.setUpdator(messageTemplate.getUpdator()) .setMsgStatus(MessageStatus.INIT.getCode()).setAuditStatus(AuditStatus.WAIT_AUDIT.getCode()); + // 从数据库查询并注入 定时任务 ID + MessageTemplate dbMsg = queryById(messageTemplate.getId()); + if (Objects.nonNull(dbMsg) && Objects.nonNull(dbMsg.getCronTaskId())) { + messageTemplate.setCronTaskId(dbMsg.getCronTaskId()); + } + if (Objects.nonNull(messageTemplate.getCronTaskId()) && TemplateType.CLOCKING.getCode().equals(messageTemplate.getTemplateType())) { XxlJobInfo xxlJobInfo = xxlJobUtils.buildXxlJobInfo(messageTemplate); cronTaskService.saveCronTask(xxlJobInfo); From 08ee731f013d4406953d28be590864d43ccf61c8 Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Fri, 9 Jun 2023 17:18:59 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=94=AF=E6=8C=81=20=E4=BA=91=E7=89=87?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=9F=AD=E4=BF=A1=20tpl=5Fvalue=20=E4=BC=A0?= =?UTF-8?q?=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/script/impl/YunPianSmsScript.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java b/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java index 7ba8bd3..fc590a3 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/script/impl/YunPianSmsScript.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.URLUtil; import cn.hutool.http.Header; import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSON; @@ -22,7 +23,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.net.URLEncoder; import java.util.*; +import java.util.stream.Collectors; /** * @author 3y @@ -37,6 +40,9 @@ public class YunPianSmsScript implements SmsScript { @Autowired private AccountUtils accountUtils; + private static final String PARAMS_SPLIT_KEY = "{|}"; + + private static final String PARAMS_KV_SPLIT_KEY = "{:}"; @Override public List send(SmsParam smsParam) { @@ -78,7 +84,7 @@ public class YunPianSmsScript implements SmsScript { params.put("apikey", account.getApikey()); params.put("mobile", StringUtils.join(smsParam.getPhones(), StrUtil.C_COMMA)); params.put("tpl_id", account.getTplId()); - params.put("tpl_value", ""); + params.put("tpl_value", getTplValue(smsParam)); return params; } @@ -113,5 +119,17 @@ public class YunPianSmsScript implements SmsScript { } + private String getTplValue(SmsParam smsParam) { + String tplValue = ""; + if (StrUtil.isNotBlank(smsParam.getContent())) { + tplValue = StrUtil.split(smsParam.getContent(), PARAMS_SPLIT_KEY).stream().map(item -> { + List kv = StrUtil.splitTrim(item, PARAMS_KV_SPLIT_KEY, 2); + return String.join("=", URLUtil.encodeQuery(kv.get(0)), URLUtil.encodeQuery(kv.get(1))); + }).collect(Collectors.joining("&")); + } + return tplValue; + } + + } From d09e3b78bc957a77b125fbd385644a6a90e3258f Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Tue, 13 Jun 2023 19:19:55 +0800 Subject: [PATCH 4/8] =?UTF-8?q?Fixes=20=E5=BE=AE=E4=BF=A1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=A7=A3=E6=9E=90=E8=BF=94=E5=9B=9E=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E5=AF=BC=E8=87=B4=E5=A4=84=E7=90=86=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java3y/austin/web/utils/Convert4Amis.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/austin-web/src/main/java/com/java3y/austin/web/utils/Convert4Amis.java b/austin-web/src/main/java/com/java3y/austin/web/utils/Convert4Amis.java index 5d34fb5..f5d8550 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/utils/Convert4Amis.java +++ b/austin-web/src/main/java/com/java3y/austin/web/utils/Convert4Amis.java @@ -170,16 +170,18 @@ public class Convert4Amis { .build(); List columnsDtoS = new ArrayList<>(); for (String datum : data) { - String name = datum.substring(datum.indexOf("{{") + 2, datum.indexOf(".")); - CommonAmisVo.ColumnsDTO.ColumnsDTOBuilder dtoBuilder = CommonAmisVo.ColumnsDTO.builder().name(name).type("input-text").required(true).quickEdit(true); - if (datum.contains("first")) { - dtoBuilder.label("名字"); - } else if (datum.contains("remark")) { - dtoBuilder.label("备注"); - } else { - dtoBuilder.label(datum.split(":")[0]); + if (StrUtil.isNotEmpty(datum)) { + String name = datum.substring(datum.indexOf("{{") + 2, datum.indexOf(".")); + CommonAmisVo.ColumnsDTO.ColumnsDTOBuilder dtoBuilder = CommonAmisVo.ColumnsDTO.builder().name(name).type("input-text").required(true).quickEdit(true); + if (datum.contains("first")) { + dtoBuilder.label("名字"); + } else if (datum.contains("remark")) { + dtoBuilder.label("备注"); + } else { + dtoBuilder.label(datum.split(":")[0]); + } + columnsDtoS.add(dtoBuilder.build()); } - columnsDtoS.add(dtoBuilder.build()); } officialAccountParam.setColumns(columnsDtoS); From 4587c97511b7f5ec740c4abddab5f9698b8fc4bb Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Wed, 14 Jun 2023 11:46:33 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20Flink=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=B8=BA=201.17.1=20&=20=E8=A7=A3=E5=86=B3=20Kafka=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98=20&=20Re?= =?UTF-8?q?dis=20=E6=94=AF=E6=8C=81=20=E5=93=A8=E5=85=B5=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- austin-data-house/pom.xml | 4 ++-- austin-stream/pom.xml | 11 +++++----- .../stream/constants/AustinFlinkConstant.java | 13 +++++++++++- .../stream/utils/LettuceRedisUtils.java | 17 ++++++++++++---- pom.xml | 20 ++++++++++++------- 5 files changed, 46 insertions(+), 19 deletions(-) diff --git a/austin-data-house/pom.xml b/austin-data-house/pom.xml index 30b5381..dba1fab 100644 --- a/austin-data-house/pom.xml +++ b/austin-data-house/pom.xml @@ -23,13 +23,13 @@ org.apache.flink flink-connector-hive_2.12 - 1.16.0 + ${flink.version} provided org.apache.flink flink-table-api-java-bridge - 1.16.0 + ${flink.version} provided diff --git a/austin-stream/pom.xml b/austin-stream/pom.xml index 3bc7137..f995bf6 100644 --- a/austin-stream/pom.xml +++ b/austin-stream/pom.xml @@ -15,26 +15,27 @@ org.apache.flink - flink-walkthrough-common_${scala.binary.version} + flink-walkthrough-common ${flink.version} org.apache.flink - flink-streaming-java_${scala.binary.version} + flink-streaming-java ${flink.version} provided org.apache.flink - flink-clients_${scala.binary.version} + flink-clients ${flink.version} provided + org.apache.flink - flink-connector-kafka_${scala.binary.version} + flink-connector-kafka ${flink.version} @@ -85,7 +86,7 @@ META-INF/spring.schemas + implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> com.java3y.austin.stream.AustinBootStrap diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java b/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java index 7bf2262..d02afae 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java @@ -22,10 +22,21 @@ public class AustinFlinkConstant { * TODO 使用前配置redis ip:port * (真实网络ip,这里不能用配置的hosts,看语雀文档得到真实ip) */ + + public static final String REDIS_MODE_SENTINEL = "SENTINEL"; + + public static final String REDIS_MODE_SINGLE = "SINGLE"; + + public static final String REDIS_MODE = REDIS_MODE_SENTINEL; + public static final String REDIS_IP = "austin-redis"; - public static final String REDIS_PORT = "6379"; + + public static final Integer REDIS_PORT = 6379; + public static final String REDIS_PASSWORD = "austin"; + public static final String MASTER_ID = "mymaster"; + /** * Flink流程常量 diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java index 0c64cd2..7c9269a 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java @@ -1,5 +1,6 @@ package com.java3y.austin.stream.utils; +import cn.hutool.core.util.StrUtil; import com.java3y.austin.stream.callback.RedisPipelineCallBack; import com.java3y.austin.stream.constants.AustinFlinkConstant; import io.lettuce.core.LettuceFutures; @@ -26,10 +27,18 @@ public class LettuceRedisUtils { private static RedisClient redisClient; static { - RedisURI redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) - .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) - .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) - .build(); + RedisURI redisUri = null; + if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SENTINEL, AustinFlinkConstant.REDIS_MODE)) { + redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.MASTER_ID) + .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) + .build(); + } else if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SINGLE, AustinFlinkConstant.REDIS_MODE)) { + redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) + .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) + .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) + .build(); + } + redisClient = RedisClient.create(redisUri); } diff --git a/pom.xml b/pom.xml index 7692650..80e2a69 100644 --- a/pom.xml +++ b/pom.xml @@ -32,9 +32,8 @@ 1.8 UTF-8 - 1.14.3 + 1.17.1 1.8 - 2.11 ${target.java.version} ${target.java.version} 2.17.1 @@ -54,7 +53,7 @@ cn.hutool hutool-all - 5.7.15 + 5.8.16 @@ -135,21 +134,28 @@ 2.3.0 + + + org.apache.kafka + kafka-clients + 3.2.3 + + org.apache.flink - flink-walkthrough-common_${scala.binary.version} + flink-walkthrough-common ${flink.version} org.apache.flink - flink-streaming-java_${scala.binary.version} + flink-streaming-java ${flink.version} provided org.apache.flink - flink-clients_${scala.binary.version} + flink-clients ${flink.version} provided @@ -157,7 +163,7 @@ org.apache.flink - flink-connector-kafka_${scala.binary.version} + flink-connector-kafka ${flink.version} From 2f333c8aa9a4fb49fb2690520dce71a846c01c99 Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Wed, 14 Jun 2023 11:48:27 +0800 Subject: [PATCH 6/8] =?UTF-8?q?Fixes=20=E5=93=A8=E5=85=B5=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=9C=AA=E8=AE=BE=E7=BD=AE=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/java3y/austin/stream/utils/LettuceRedisUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java index 7c9269a..bed24bc 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java @@ -29,12 +29,12 @@ public class LettuceRedisUtils { static { RedisURI redisUri = null; if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SENTINEL, AustinFlinkConstant.REDIS_MODE)) { - redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.MASTER_ID) + redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.REDIS_PORT, AustinFlinkConstant.MASTER_ID) .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) .build(); } else if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SINGLE, AustinFlinkConstant.REDIS_MODE)) { redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) - .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) + .withPort(AustinFlinkConstant.REDIS_PORT) .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) .build(); } From 270b989082f132909c639de03f8c61e704893f36 Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Mon, 19 Jun 2023 09:44:39 +0800 Subject: [PATCH 7/8] =?UTF-8?q?Revert=20"Fixes=20=E5=93=A8=E5=85=B5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=9C=AA=E8=AE=BE=E7=BD=AE=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 2f333c8aa9a4fb49fb2690520dce71a846c01c99. --- .../com/java3y/austin/stream/utils/LettuceRedisUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java index bed24bc..7c9269a 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java @@ -29,12 +29,12 @@ public class LettuceRedisUtils { static { RedisURI redisUri = null; if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SENTINEL, AustinFlinkConstant.REDIS_MODE)) { - redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.REDIS_PORT, AustinFlinkConstant.MASTER_ID) + redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.MASTER_ID) .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) .build(); } else if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SINGLE, AustinFlinkConstant.REDIS_MODE)) { redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) - .withPort(AustinFlinkConstant.REDIS_PORT) + .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) .build(); } From 12ea08e9d2040782fd8cd4cdc8647c70c1a3e88d Mon Sep 17 00:00:00 2001 From: "sky.huang" Date: Mon, 19 Jun 2023 09:44:45 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Revert=20"=E5=8D=87=E7=BA=A7=20Flink=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=BA=201.17.1=20&=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=20Kafka=20=E4=BE=9D=E8=B5=96=E5=86=B2=E7=AA=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20&=20Redis=20=E6=94=AF=E6=8C=81=20=E5=93=A8=E5=85=B5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=BF=9E=E6=8E=A5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4587c97511b7f5ec740c4abddab5f9698b8fc4bb. --- austin-data-house/pom.xml | 4 ++-- austin-stream/pom.xml | 11 +++++----- .../stream/constants/AustinFlinkConstant.java | 13 +----------- .../stream/utils/LettuceRedisUtils.java | 17 ++++------------ pom.xml | 20 +++++++------------ 5 files changed, 19 insertions(+), 46 deletions(-) diff --git a/austin-data-house/pom.xml b/austin-data-house/pom.xml index dba1fab..30b5381 100644 --- a/austin-data-house/pom.xml +++ b/austin-data-house/pom.xml @@ -23,13 +23,13 @@ org.apache.flink flink-connector-hive_2.12 - ${flink.version} + 1.16.0 provided org.apache.flink flink-table-api-java-bridge - ${flink.version} + 1.16.0 provided diff --git a/austin-stream/pom.xml b/austin-stream/pom.xml index f995bf6..3bc7137 100644 --- a/austin-stream/pom.xml +++ b/austin-stream/pom.xml @@ -15,27 +15,26 @@ org.apache.flink - flink-walkthrough-common + flink-walkthrough-common_${scala.binary.version} ${flink.version} org.apache.flink - flink-streaming-java + flink-streaming-java_${scala.binary.version} ${flink.version} provided org.apache.flink - flink-clients + flink-clients_${scala.binary.version} ${flink.version} provided - org.apache.flink - flink-connector-kafka + flink-connector-kafka_${scala.binary.version} ${flink.version} @@ -86,7 +85,7 @@ META-INF/spring.schemas + implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> com.java3y.austin.stream.AustinBootStrap diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java b/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java index d02afae..7bf2262 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/constants/AustinFlinkConstant.java @@ -22,21 +22,10 @@ public class AustinFlinkConstant { * TODO 使用前配置redis ip:port * (真实网络ip,这里不能用配置的hosts,看语雀文档得到真实ip) */ - - public static final String REDIS_MODE_SENTINEL = "SENTINEL"; - - public static final String REDIS_MODE_SINGLE = "SINGLE"; - - public static final String REDIS_MODE = REDIS_MODE_SENTINEL; - public static final String REDIS_IP = "austin-redis"; - - public static final Integer REDIS_PORT = 6379; - + public static final String REDIS_PORT = "6379"; public static final String REDIS_PASSWORD = "austin"; - public static final String MASTER_ID = "mymaster"; - /** * Flink流程常量 diff --git a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java index 7c9269a..0c64cd2 100644 --- a/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java +++ b/austin-stream/src/main/java/com/java3y/austin/stream/utils/LettuceRedisUtils.java @@ -1,6 +1,5 @@ package com.java3y.austin.stream.utils; -import cn.hutool.core.util.StrUtil; import com.java3y.austin.stream.callback.RedisPipelineCallBack; import com.java3y.austin.stream.constants.AustinFlinkConstant; import io.lettuce.core.LettuceFutures; @@ -27,18 +26,10 @@ public class LettuceRedisUtils { private static RedisClient redisClient; static { - RedisURI redisUri = null; - if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SENTINEL, AustinFlinkConstant.REDIS_MODE)) { - redisUri = RedisURI.Builder.sentinel(AustinFlinkConstant.REDIS_IP, AustinFlinkConstant.MASTER_ID) - .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) - .build(); - } else if (StrUtil.equals(AustinFlinkConstant.REDIS_MODE_SINGLE, AustinFlinkConstant.REDIS_MODE)) { - redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) - .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) - .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) - .build(); - } - + RedisURI redisUri = RedisURI.Builder.redis(AustinFlinkConstant.REDIS_IP) + .withPort(Integer.valueOf(AustinFlinkConstant.REDIS_PORT)) + .withPassword(AustinFlinkConstant.REDIS_PASSWORD.toCharArray()) + .build(); redisClient = RedisClient.create(redisUri); } diff --git a/pom.xml b/pom.xml index 80e2a69..7692650 100644 --- a/pom.xml +++ b/pom.xml @@ -32,8 +32,9 @@ 1.8 UTF-8 - 1.17.1 + 1.14.3 1.8 + 2.11 ${target.java.version} ${target.java.version} 2.17.1 @@ -53,7 +54,7 @@ cn.hutool hutool-all - 5.8.16 + 5.7.15 @@ -134,28 +135,21 @@ 2.3.0 - - - org.apache.kafka - kafka-clients - 3.2.3 - - org.apache.flink - flink-walkthrough-common + flink-walkthrough-common_${scala.binary.version} ${flink.version} org.apache.flink - flink-streaming-java + flink-streaming-java_${scala.binary.version} ${flink.version} provided org.apache.flink - flink-clients + flink-clients_${scala.binary.version} ${flink.version} provided @@ -163,7 +157,7 @@ org.apache.flink - flink-connector-kafka + flink-connector-kafka_${scala.binary.version} ${flink.version}