We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e81bc1 commit 87e8a1cCopy full SHA for 87e8a1c
1 file changed
packages/kafka/lib/utils/KafkaMessageBatchStream.ts
@@ -110,8 +110,12 @@ export class KafkaMessageBatchStream<TMessage extends MessageWithTopicAndPartiti
110
}
111
112
override _final(callback: CallbackFunction) {
113
- this.flushMessages()
114
- this.push(null) // Signal end-of-stream to the readable side
+ // Clean timeout
+ clearTimeout(this.existingTimeout)
115
+ this.existingTimeout = undefined
116
+ // If there are remaining messages -> skip them
117
+ // As they are not committed, the next consumer will process them
118
+ this.messages = []
119
callback()
120
121
0 commit comments