Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ v1.3.1 is a maintenance release. It is supported for all usage.

## Fixes

1. Avoid a race condition that causes 100% usage of a CPU core when
1. Avoid a race condition that causes 100% usage of a CPU core when
consuming with `partitionsConsumedConcurrently > 1` and all messages
are consumed (#300)
2. Fix type definition for `Kafka()` constructor and for passing topic configurations
to the `producer()` and `consumer()` in the promisified API (@davidkhala, #297, #).


# confluent-kafka-javascript v1.3.0
Expand Down
17 changes: 13 additions & 4 deletions types/kafkajs.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ConsumerGlobalConfig, GlobalConfig, ProducerGlobalConfig } from './config'
import {
ConsumerGlobalConfig,
ConsumerTopicConfig,
GlobalConfig,
ProducerGlobalConfig,
ProducerTopicConfig } from './config'
import {
ConsumerGroupStates,
GroupOverview,
Expand Down Expand Up @@ -94,7 +99,7 @@ export interface CommonConstructorConfig extends GlobalConfig {
}

export class Kafka {
constructor(config: CommonConstructorConfig)
constructor(config?: CommonConstructorConfig)
producer(config?: ProducerConstructorConfig): Producer
consumer(config: ConsumerConstructorConfig): Consumer
admin(config?: AdminConstructorConfig): Admin
Expand Down Expand Up @@ -131,7 +136,9 @@ export interface ProducerConfig {
logger?: Logger,
}

export interface ProducerConstructorConfig extends ProducerGlobalConfig {
type ProducerGlobalAndTopicConfig = ProducerGlobalConfig & ProducerTopicConfig;

export interface ProducerConstructorConfig extends ProducerGlobalAndTopicConfig {
kafkaJS?: ProducerConfig;
}

Expand Down Expand Up @@ -235,7 +242,9 @@ export interface ConsumerConfig {
partitionAssignors?: PartitionAssignors[],
}

export interface ConsumerConstructorConfig extends ConsumerGlobalConfig {
export type ConsumerGlobalAndTopicConfig = ConsumerGlobalConfig & ConsumerTopicConfig;

export interface ConsumerConstructorConfig extends ConsumerGlobalAndTopicConfig {
kafkaJS?: ConsumerConfig;
}

Expand Down