npm / @confluentinc/kafka-javascript
@confluentinc/kafka-javascript
What changed in @confluentinc/kafka-javascript 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-14.
2 breaking1 security22 new APIs and options5 behavior and defaults28 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@confluentinc/kafka-javascript 158 changes
Breaking changes 2
Promisified producer.connect() and consumer.connect() retry transient connection errors by default, with retry.retries defaulting to 5; set it to 0 for single-attempt behavior.
send() rejects an invalid topic or messages list before serialization, and serializer failures are reported as KeySerializationError or ValueSerializationError with the original error as cause.
Security 1
Fix security vulnerabilities in dependencies.
New APIs and options 22
Support was added for saving the Azure key version with a DEK.
Producer, consumer, and admin clients can fetch the id of their connected cluster through the node-rdkafka and promisified APIs; this is experimental.
Decimal was added as a CEL function.
Support was added for inline validation rules.
An experimental producer property accepts a serializer builder that is built while connecting and applied to keys.
An experimental producer property accepts a serializer builder that is built while connecting and applied to values.
Support was added for generating a JSON Schema title from a JSON payload.
An experimental builder was added for integrating an Avro deserializer with the promisified Kafka clients.
An experimental builder was added for integrating an Avro serializer with the promisified Kafka clients.
An experimental builder was added for integrating a JSON deserializer with the promisified Kafka clients.
An experimental builder was added for integrating a JSON serializer with the promisified Kafka clients.
An experimental builder was added for integrating a Protobuf deserializer with the promisified Kafka clients.
An experimental builder was added for integrating a Protobuf serializer with the promisified Kafka clients.
Timestamp was added as a CEL function.
Variant was added as a CEL function.
Adds support for union-of-pools/auto-pool mapping for schema registry.
Adds AssociatedNameStrategy.
Adds enableAt to RuleSet.
Exported from the schemaregistry index.ts, making CelExecutor available to consumers.
Exported from the schemaregistry index.ts, making CelFieldExecutor available to consumers.
Batch size is configurable through this property.
Cache size is configurable through this property.
Behavior and default changes 5
The default builder strategy lazily resolves the Kafka cluster id on first subject lookup; an explicit cluster id takes precedence, and concurrent resolutions share one call.
Clients pass context when making KEK calls to the DEK Registry.
Deserializer failures are attached to the message as deserializedKey.error or deserializedValue.error, so the record is still delivered.
The wait between connection attempts grows exponentially from retry.initialRetryTime up to retry.maxRetryTime with jitter; these settings also map to librdkafka reconnect backoff properties.
Reporting for JSON Schema validation was slightly enhanced.
Fixes and other changes 28
Concurrent connect() calls on the same client share a single in-flight connection attempt instead of the second call throwing.
Prebuilt binaries are now available for linux-s390x with both glibc and musl.
The property is now mapped from retry.maxRetryTime so librdkafka reconnection attempts use the same backoff.
The property is now mapped from retry.initialRetryTime so librdkafka reconnection attempts use the same backoff.
An explicitly configured cluster id takes precedence over lazy cluster-id resolution by the default builder strategy.
Prevents a crash if an admin operation fails before its result event is received.
A message is stored as the last consumed offset only after processing eachMessage or resolving offsets in eachBatch, when it is stored for commitment.
References librdkafka 2.15.1; see its release notes for details.
HTTP status is preserved on Schema Registry error responses.
Avoids a duplicate message when seeking back to reprocess a message or batch.
Handles non-HTTP errors during retries.
Correct the TypeScript MemberDescription shape: assignment and targetAssignment wrap a topicPartitions array, while memberAssignment and memberMetadata are nullable.
Correct FetchOffsetsPartition.error to LibrdKafkaError | null, matching the runtime, which always populates the field.
Correct its TypeScript return type to Promise<Array<ITopicMetadata>>.
Fix error callback passing and pass an object to the logger instead of a string.
Resolve the IHeaders import for installed clients.
Handle anyOf and allOf in JSON transforms.
Handle missing Protobuf message index bytes during deserialization.
Serde constructors now preserve a custom subjectNameStrategy.
Fix the broken types path so TypeScript consumers get types.
Avro arrays are processed sequentially to avoid race conditions.
NULL checks prevent segfaults when Kafka metadata contains NULL values during broker restarts.
Prevents fetch failures when max batch size is set or uses its default and the consumption rate is low.
Ensures the maximum message cache size does not reach zero by keeping at least one message per worker after rounding up.
The rule failure message was improved.
Fixes a case where the at-least-once guarantee was not ensured when seeking one partition while messages were being fetched for other partitions.
Prevents returning a negative lag when there is no cached offset for the HWM.
The statistics callback is now available with the promisified API for all client types.