From 7e73b79b758f4f7c8a8e3cc3061f1c7610d94a43 Mon Sep 17 00:00:00 2001 From: Kjell Winblad Date: Tue, 12 Mar 2024 12:52:54 +0100 Subject: [PATCH] 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 --- .../src/emqx_bridge_kinesis.erl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/emqx_bridge_kinesis/src/emqx_bridge_kinesis.erl b/apps/emqx_bridge_kinesis/src/emqx_bridge_kinesis.erl index 06cf76cf5..93cf2413d 100644 --- a/apps/emqx_bridge_kinesis/src/emqx_bridge_kinesis.erl +++ b/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) }} ]);