File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ v1.3.1 is a maintenance release. It is supported for all usage.
44
55## Fixes
66
7- 1 . Avoid a race condition that causes 100% usage of a CPU core when
7+ 1 . Avoid a race condition that causes 100% usage of a CPU core when
88 consuming with ` partitionsConsumedConcurrently > 1 ` and all messages
99 are consumed (#300 )
10+ 2 . Fix type definition for ` Kafka() ` constructor and for passing topic configurations
11+ to the ` producer() ` and ` consumer() ` in the promisified API (@davidkhala , #297 , #321 ).
1012
1113
1214# confluent-kafka-javascript v1.3.0
Original file line number Diff line number Diff line change 1- import { ConsumerGlobalConfig , GlobalConfig , ProducerGlobalConfig } from './config'
1+ import {
2+ ConsumerGlobalConfig ,
3+ ConsumerTopicConfig ,
4+ GlobalConfig ,
5+ ProducerGlobalConfig ,
6+ ProducerTopicConfig } from './config'
27import {
38 ConsumerGroupStates ,
49 GroupOverview ,
@@ -94,7 +99,7 @@ export interface CommonConstructorConfig extends GlobalConfig {
9499}
95100
96101export class Kafka {
97- constructor ( config : CommonConstructorConfig )
102+ constructor ( config ? : CommonConstructorConfig )
98103 producer ( config ?: ProducerConstructorConfig ) : Producer
99104 consumer ( config : ConsumerConstructorConfig ) : Consumer
100105 admin ( config ?: AdminConstructorConfig ) : Admin
@@ -131,7 +136,9 @@ export interface ProducerConfig {
131136 logger ?: Logger ,
132137}
133138
134- export interface ProducerConstructorConfig extends ProducerGlobalConfig {
139+ type ProducerGlobalAndTopicConfig = ProducerGlobalConfig & ProducerTopicConfig ;
140+
141+ export interface ProducerConstructorConfig extends ProducerGlobalAndTopicConfig {
135142 kafkaJS ?: ProducerConfig ;
136143}
137144
@@ -235,7 +242,9 @@ export interface ConsumerConfig {
235242 partitionAssignors ?: PartitionAssignors [ ] ,
236243}
237244
238- export interface ConsumerConstructorConfig extends ConsumerGlobalConfig {
245+ export type ConsumerGlobalAndTopicConfig = ConsumerGlobalConfig & ConsumerTopicConfig ;
246+
247+ export interface ConsumerConstructorConfig extends ConsumerGlobalAndTopicConfig {
239248 kafkaJS ?: ConsumerConfig ;
240249}
241250
You can’t perform that action at this time.
0 commit comments