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.
4
4
5
5
## Fixes
6
6
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
8
8
consuming with ` partitionsConsumedConcurrently > 1 ` and all messages
9
9
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 ).
10
12
11
13
12
14
# 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'
2
7
import {
3
8
ConsumerGroupStates ,
4
9
GroupOverview ,
@@ -94,7 +99,7 @@ export interface CommonConstructorConfig extends GlobalConfig {
94
99
}
95
100
96
101
export class Kafka {
97
- constructor ( config : CommonConstructorConfig )
102
+ constructor ( config ? : CommonConstructorConfig )
98
103
producer ( config ?: ProducerConstructorConfig ) : Producer
99
104
consumer ( config : ConsumerConstructorConfig ) : Consumer
100
105
admin ( config ?: AdminConstructorConfig ) : Admin
@@ -131,7 +136,9 @@ export interface ProducerConfig {
131
136
logger ?: Logger ,
132
137
}
133
138
134
- export interface ProducerConstructorConfig extends ProducerGlobalConfig {
139
+ type ProducerGlobalAndTopicConfig = ProducerGlobalConfig & ProducerTopicConfig ;
140
+
141
+ export interface ProducerConstructorConfig extends ProducerGlobalAndTopicConfig {
135
142
kafkaJS ?: ProducerConfig ;
136
143
}
137
144
@@ -235,7 +242,9 @@ export interface ConsumerConfig {
235
242
partitionAssignors ?: PartitionAssignors [ ] ,
236
243
}
237
244
238
- export interface ConsumerConstructorConfig extends ConsumerGlobalConfig {
245
+ export type ConsumerGlobalAndTopicConfig = ConsumerGlobalConfig & ConsumerTopicConfig ;
246
+
247
+ export interface ConsumerConstructorConfig extends ConsumerGlobalAndTopicConfig {
239
248
kafkaJS ?: ConsumerConfig ;
240
249
}
241
250
You can’t perform that action at this time.
0 commit comments