From 2422b2bded2a8c39e4d746e5d458c81000d075f3 Mon Sep 17 00:00:00 2001 From: yanghq <1040926235@qq.com> Date: Thu, 14 Mar 2024 11:35:04 +0800 Subject: [PATCH] 1.1.0 --- .../lokitest/controller/TestController.java | 12 ++++++++++- .../lokitest/mapper/TestMapper.java | 3 +++ .../main/resources/application-sentinel.yml | 20 ++++++++++++++++++ .../src/main/resources/application-single.yml | 15 +++++++++++++ .../src/main/resources/application.yml | 21 ++----------------- pom.xml | 2 +- 6 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 loki-redis-test/src/main/resources/application-sentinel.yml create mode 100644 loki-redis-test/src/main/resources/application-single.yml diff --git a/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/controller/TestController.java b/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/controller/TestController.java index 8d7381f..5559665 100644 --- a/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/controller/TestController.java +++ b/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/controller/TestController.java @@ -55,6 +55,16 @@ public String customSend2() { return "success"; } + @GetMapping("customSend3") + public String customSend3() { + TestEntity entity = new TestEntity(); + entity.setId("9521"); + entity.setMessage("test"); + String messageId = testMapper.customSend3(entity); + log.debug("send messageId:{}", messageId); + return "success"; + } + @GetMapping("customAsyncSend") public String customAsyncSend() throws ExecutionException, InterruptedException { TestEntity entity = new TestEntity(); @@ -65,4 +75,4 @@ public String customAsyncSend() throws ExecutionException, InterruptedException log.debug("send messageId:{}", messageId); return "success"; } -} \ No newline at end of file +} diff --git a/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/mapper/TestMapper.java b/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/mapper/TestMapper.java index 9bb023b..24ab8ac 100644 --- a/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/mapper/TestMapper.java +++ b/loki-redis-test/src/main/java/io/github/guoshiqiufeng/lokitest/mapper/TestMapper.java @@ -19,6 +19,9 @@ public interface TestMapper extends BaseMapper { @SendMessage(topic = "loki", tag = "custom", message = "#entity.message", messageKey = "#entity.id") String customSend2(TestEntity entity); + @SendMessage(topic = "loki", tag = "custom", message = "#entity.message", messageKey = "#entity.id", deliveryTimestamp = 10000) + String customSend3(TestEntity entity); + @SendMessage(topic = "loki", tag = "custom", async = true, message = "#entity.message", messageKey = "#entity.id") CompletableFuture customAsyncSend(TestEntity entity); diff --git a/loki-redis-test/src/main/resources/application-sentinel.yml b/loki-redis-test/src/main/resources/application-sentinel.yml new file mode 100644 index 0000000..deafc7f --- /dev/null +++ b/loki-redis-test/src/main/resources/application-sentinel.yml @@ -0,0 +1,20 @@ +spring: + data: + redis: + sentinel: + master: mymaster + nodes: + - 127.0.0.1:26380 + - 127.0.0.1:26379 + - 127.0.0.1:26381 + password: 123456 + password: 123456 + database: 12 + +loki: + global-config: + mq-config: + mq-type: redis + address: mymaster,127.0.0.1:26380,127.0.0.1:26379,127.0.0.1:26381 + auth: true + password: 123456 diff --git a/loki-redis-test/src/main/resources/application-single.yml b/loki-redis-test/src/main/resources/application-single.yml new file mode 100644 index 0000000..902c0a4 --- /dev/null +++ b/loki-redis-test/src/main/resources/application-single.yml @@ -0,0 +1,15 @@ +spring: + data: + redis: + host: 127.0.0.1 + #password: 123456 + database: 12 + +loki: + global-config: + mq-config: + mq-type: redis + address: 127.0.0.1:6379 + auth: false + password: 123456 + redis-history-delay-message-send: true diff --git a/loki-redis-test/src/main/resources/application.yml b/loki-redis-test/src/main/resources/application.yml index 65510a4..7d5b7c8 100644 --- a/loki-redis-test/src/main/resources/application.yml +++ b/loki-redis-test/src/main/resources/application.yml @@ -6,22 +6,5 @@ logging: io.github.guoshiqiufeng.lokitest: debug spring: - data: - redis: - sentinel: - master: mymaster - nodes: - - 127.0.0.1:26380 - - 127.0.0.1:26379 - - 127.0.0.1:26381 - password: 123456 - password: 123456 - database: 12 - -loki: - global-config: - mq-config: - mq-type: redis - address: mymaster,127.0.0.1:26380,127.0.0.1:26379,127.0.0.1:26381 - auth: true - password: 123456 \ No newline at end of file + profiles: + active: single diff --git a/pom.xml b/pom.xml index d1f6195..3b77642 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 17 - 1.0.1 + 1.1.0