Просмотр исходного кода

fix(Amazon Kinesis Action): batch size restriction

Make sure that the Amazon Kinesis action has the same batch size
restriction as the Amazon Kinesis bridge.

Fixes:
https://emqx.atlassian.net/browse/EMQX-11983
Kjell Winblad 1 год назад
Родитель
Сommit
7e73b79b75
1 измененных файлов с 14 добавлено и 1 удалено
  1. 14 1
      apps/emqx_bridge_kinesis/src/emqx_bridge_kinesis.erl

+ 14 - 1
apps/emqx_bridge_kinesis/src/emqx_bridge_kinesis.erl

@@ -62,7 +62,19 @@ fields(kinesis_action) ->
                 required => true,
                 desc => ?DESC("action_parameters")
             }
-        )
+        ),
+        #{
+            resource_opts_ref => hoconsc:ref(?MODULE, action_resource_opts)
+        }
+    );
+fields(action_resource_opts) ->
+    emqx_bridge_v2_schema:action_resource_opts_fields(
+        _Overrides = [
+            {batch_size, #{
+                type => range(1, 500),
+                validator => emqx_resource_validator:max(int, 500)
+            }}
+        ]
     );
 fields("config_producer") ->
     emqx_bridge_schema:common_bridge_fields() ++
@@ -84,6 +96,7 @@ fields("resource_opts") ->
 fields("creation_opts") ->
     emqx_resource_schema:create_opts([
         {batch_size, #{
+            type => range(1, 500),
             validator => emqx_resource_validator:max(int, 500)
         }}
     ]);