Skip to content

Commit cb314d4

Browse files
committed
Fix CompressionTypes.Snappy naming for KafkaJS compatibility
Rename SNAPPY to Snappy to match the original KafkaJS API naming convention, ensuring backward compatibility for users migrating from kafkajs. Also fixes mismatch between TypeScript types and JavaScript implementation.
1 parent 2fef45b commit cb314d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/kafkajs/_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const CompatibilityErrorMessages = Object.freeze({
244244
sendOptionsAcks: (fn) =>
245245
createReplacementErrorMessage('producer', fn, 'acks', 'acks: <number>', 'acks: <number>', false),
246246
sendOptionsCompression: (fn) =>
247-
createReplacementErrorMessage('producer', fn, 'compression', 'compression: <type>', 'compression: CompressionTypes.GZIP|SNAPPY|LZ4|ZSTD', false),
247+
createReplacementErrorMessage('producer', fn, 'compression', 'compression: <type>', 'compression: CompressionTypes.GZIP|Snappy|LZ4|ZSTD', false),
248248
sendOptionsTimeout: (fn) =>
249249
createReplacementErrorMessage('producer', fn, 'timeout', 'timeout: <number>', 'timeout: <number>', false),
250250
sendBatchMandatoryMissing: () =>

lib/kafkajs/_producer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ProducerState = Object.freeze({
3434
const CompressionTypes = {
3535
None: 'none',
3636
GZIP: 'gzip',
37-
SNAPPY: 'snappy',
37+
Snappy: 'snappy',
3838
LZ4: 'lz4',
3939
ZSTD: 'zstd',
4040
};

0 commit comments

Comments
 (0)