A typical single-threaded model could be: first, it retrieves records using the poll() method, and then it processing fetched records.
Because records are fetched and processed by the same thread, they are processed in the same order as they were written to the partition. This ensures the processing order guarantees.
For example, in AWS Kinesis with Lambda architecture, you can change the batch size which controls the maximum number of records that can be sent to your Lambda function with each invoke.
increase the Lambda batch size will increase throughput
Multithreading is “the ability of a central processing unit (CPU) (or a single core in a multi-core processor) to provide multiple threads of execution concurrently, supported by the operating system.” In situations where the work can be divided into smaller units, which can be run in parallel, without negative effects on data consistency, multithreading can be used to improve application performance.
a multi-threaded model
A multi-threaded model may be processing each message in a separate thread taken from a thread pool, while using automatic offset commits. However, a Multi-threaded model may cause some undesirable effects:
Offset might be committed before a record is processed by consumers
Message processing order can’t be guaranteed since messages from the same partition could be processed in parallel
Multi-threaded model is useful when the other system can accept such high load and when there is no dependency on the order of processing.