From 79770263eb1d00225e944c5d9a262543f81b60ef Mon Sep 17 00:00:00 2001 From: chw <> Date: Thu, 11 Dec 2025 17:37:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E5=A6=82=E6=9E=9C=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=EF=BC=9A?= =?UTF-8?q?ERR=20unknown=20command=20'HELLO'=20=EF=BC=8C=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8F=90=E9=86=92=E7=94=A8=E6=88=B7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5redis=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/tech/smartboot/redisun/RedisMessageProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java b/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java index 52734ee..0b0170c 100644 --- a/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java +++ b/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java @@ -101,7 +101,12 @@ class RedisMessageProcessor extends AbstractMessageProcessor implements Pr return; } if (msg instanceof SimpleErrors) { - future.completeExceptionally(new RedisunException(msg.getValue().toString())); + String errorMessage = msg.getValue().toString(); + if (errorMessage.contains("ERR unknown command 'HELLO'")) { + future.completeExceptionally(new RedisunException("Please check the Redis version, which should be greater than or equal to 6.0.0")); + } else { + future.completeExceptionally(new RedisunException(errorMessage)); + } } else { future.complete(msg); } -- Gitee From 65dee9adbbf79f0147b75736b43f052f0e03eb3d Mon Sep 17 00:00:00 2001 From: chw <> Date: Thu, 11 Dec 2025 17:48:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"feat:=20=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=9AERR=20unknown=20command=20'HELLO'=20=EF=BC=8C=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E5=BC=82=E5=B8=B8=E6=8F=90=E9=86=92=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5redis=E7=89=88=E6=9C=AC=E3=80=82"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 79770263eb1d00225e944c5d9a262543f81b60ef. --- .../java/tech/smartboot/redisun/RedisMessageProcessor.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java b/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java index 0b0170c..52734ee 100644 --- a/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java +++ b/src/main/java/tech/smartboot/redisun/RedisMessageProcessor.java @@ -101,12 +101,7 @@ class RedisMessageProcessor extends AbstractMessageProcessor implements Pr return; } if (msg instanceof SimpleErrors) { - String errorMessage = msg.getValue().toString(); - if (errorMessage.contains("ERR unknown command 'HELLO'")) { - future.completeExceptionally(new RedisunException("Please check the Redis version, which should be greater than or equal to 6.0.0")); - } else { - future.completeExceptionally(new RedisunException(errorMessage)); - } + future.completeExceptionally(new RedisunException(msg.getValue().toString())); } else { future.complete(msg); } -- Gitee From 6d6374e741d522cc45ffeb5b3c03ec2c713f0512 Mon Sep 17 00:00:00 2001 From: chw <> Date: Thu, 11 Dec 2025 17:54:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=A6=82=E6=9E=9CHELLO=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=BF=94=E5=9B=9E=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9AERR=20unknown=20command=20'HELLO'=20=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8=E6=8F=90=E9=86=92=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=A3=80=E6=9F=A5redis=E7=89=88=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/tech/smartboot/redisun/Redisun.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/tech/smartboot/redisun/Redisun.java b/src/main/java/tech/smartboot/redisun/Redisun.java index 87ad8fe..6830c2b 100644 --- a/src/main/java/tech/smartboot/redisun/Redisun.java +++ b/src/main/java/tech/smartboot/redisun/Redisun.java @@ -123,7 +123,16 @@ public final class Redisun { HelloCommand helloCommand = new HelloCommand(); helloCommand.setUsername(options.getUsername()); helloCommand.setPassword(options.getPassword()); - syncExecute(helloCommand); + try { + syncExecute(helloCommand); + } catch (RedisunException e) { + String message = e.getMessage(); + if (message != null && message.contains("ERR unknown command 'HELLO'")) { + throw new RedisunException("Please check the Redis version, which should be greater than or equal to 6.0.0"); + } else { + throw e; + } + } // 如果配置的数据库不为0,则自动切换数据库 if (options.getDatabase() != 0) { -- Gitee