kafka-connect-lambda icon indicating copy to clipboard operation
kafka-connect-lambda copied to clipboard

Batch max size question

Open Amertz08 opened this issue 4 years ago • 4 comments

We are attempting to reduce the number of messages being processed by each lambda invocation. We have batching enabled but it doesn't appear that you can configure the message count. It looks like there is a hard coded value for the bytes size of the batch here https://github.com/Nordstrom/kafka-connect-lambda/blob/eec53066f588cce5255a6d98086fb02cca695805/src/main/java/com/nordstrom/kafka/connect/lambda/LambdaSinkTask.java#L26.

Is it even possible?

Amertz08 avatar Jul 02 '20 14:07 Amertz08

6MB is the AWS Lambda payload max limit: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

Setting a smaller value through configuration, say aws.lambda.batch.max.bytes, seems like a reasonable addition.

dylanmei avatar Jul 02 '20 17:07 dylanmei

Gotcha. What we're wondering is how to only send N messages to a lambda at a time. We are seeing like 7500 messages sent and the lambda is timing out. We'd like to only send a few at a time. This doesn't appear possible with this connector.

Amertz08 avatar Jul 02 '20 17:07 Amertz08

You can control consumer batch size thought consumer.override.max.poll.records in the connector config and enable aws.lambda.batch.enabled, but before that you have to enable override policy in the worker config using connector.client.config.override.policy=All

dinegri avatar May 03 '22 21:05 dinegri

For ASYNC invocations, there is a different size limitation in AWS.

I am seeing issues when changing from SYNC to ASYNC mode.

image

I think that the default size should change based on which one of these is set

ross-paypay avatar Mar 13 '23 11:03 ross-paypay