MSK Trigger for AWS Lambda

Hi All,

I am using a lambda function which is getting triggered using MSK Trigger, and the lambda function is inserting data into DB.
I have a requirement where suppose my batch size is 10 and it fetched the records from offser 0 to 9.
suppose offset 0,1,2 got inserted properly but during offset 3 the db went down.
If I am handling the error it is skipping the 3rd offset during next run and starting from 4th.
If I am not handling the error then as part of the retry it is again processing from 0th offset only. Is there any way I can set the offset value to 3?
I understand lamda commits the offset only after the entire batch is successfull.
But is there any way I can set the offset value for the next record?

There isn’t a way to say only offset 3 failed. If the order isn’t import you could write the failure to a DLQ manually then process messages from that. This would allow you to respond successfully with the Lambda triggered from MSK. One of the more important things that people often overlook about Lambda is that your functions need to be idempotent.