Browse Source

fix(kafka): fix timeout field for some kafka fields

Change type of fields 'Partition Count Refresh Interval' and 'Offset
Commit Interval' to avoid accepting values larger than allowed.

Fixes https://emqx.atlassian.net/browse/EMQX-10196
Fixes https://emqx.atlassian.net/browse/EMQX-10199
Paulo Zulato 2 years atrás
parent
commit
720a84d48b
2 changed files with 4 additions and 3 deletions
  1. 3 3
      apps/emqx_bridge_kafka/src/emqx_bridge_kafka.erl
  2. 1 0
      changes/ee/fix-10999.en.md

+ 3 - 3
apps/emqx_bridge_kafka/src/emqx_bridge_kafka.erl

@@ -276,7 +276,7 @@ fields(producer_kafka_opts) ->
             )},
         {partition_count_refresh_interval,
             mk(
-                emqx_schema:duration_s(),
+                emqx_schema:timeout_duration_s(),
                 #{
                     default => <<"60s">>,
                     desc => ?DESC(partition_count_refresh_interval)
@@ -380,8 +380,8 @@ fields(consumer_kafka_opts) ->
             )},
         {offset_commit_interval_seconds,
             mk(
-                pos_integer(),
-                #{default => 5, desc => ?DESC(consumer_offset_commit_interval_seconds)}
+                emqx_schema:timeout_duration_s(),
+                #{default => <<"5s">>, desc => ?DESC(consumer_offset_commit_interval_seconds)}
             )}
     ].
 

+ 1 - 0
changes/ee/fix-10999.en.md

@@ -0,0 +1 @@
+Changed schema validation for Kafka fields 'Partition Count Refresh Interval' and 'Offset Commit Interval' to avoid accepting values larger then maximum allowed.