This is an automated email from the ASF dual-hosted git repository.

traky pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new e1503dcb2 fix: remove 0 from required_acks allowed values for 
kafka-logger (#10469)
e1503dcb2 is described below

commit e1503dcb2b6220303c6023d7f0fe5e591efecd8f
Author: Traky Deng <[email protected]>
AuthorDate: Fri Nov 10 17:36:11 2023 -0800

    fix: remove 0 from required_acks allowed values for kafka-logger (#10469)
---
 apisix/plugins/kafka-logger.lua |  2 +-
 t/plugin/kafka-logger2.t        | 26 +-------------------------
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/apisix/plugins/kafka-logger.lua b/apisix/plugins/kafka-logger.lua
index 2abbd1fce..bc200dc79 100644
--- a/apisix/plugins/kafka-logger.lua
+++ b/apisix/plugins/kafka-logger.lua
@@ -95,7 +95,7 @@ local schema = {
         required_acks = {
             type = "integer",
             default = 1,
-            enum = { 0, 1, -1 },
+            enum = { 1, -1 },
         },
         key = {type = "string"},
         timeout = {type = "integer", minimum = 1, default = 3},
diff --git a/t/plugin/kafka-logger2.t b/t/plugin/kafka-logger2.t
index 4aabf8756..7319a2db3 100644
--- a/t/plugin/kafka-logger2.t
+++ b/t/plugin/kafka-logger2.t
@@ -57,7 +57,7 @@ done
 
 
 
-=== TEST 2: report log to kafka, with required_acks(1, 0, -1)
+=== TEST 2: report log to kafka, with required_acks(1, -1)
 --- config
 location /t {
     content_by_lua_block {
@@ -110,30 +110,6 @@ location /t {
                     uri = "/hello",
                 },
             },
-            {
-                input = {
-                    plugins = {
-                        ["kafka-logger"] = {
-                            broker_list = {
-                                ["127.0.0.1"] = 9092
-                            },
-                            kafka_topic = "test2",
-                            producer_type = "sync",
-                            timeout = 1,
-                            batch_max_size = 1,
-                            required_acks = 0,
-                            meta_format = "origin",
-                        }
-                    },
-                    upstream = {
-                        nodes = {
-                            ["127.0.0.1:1980"] = 1
-                        },
-                        type = "roundrobin"
-                    },
-                    uri = "/hello",
-                },
-            },
         }
 
         local t = require("lib.test_admin").test

Reply via email to