kafka-node: fix message value to be string or Buffer (#23201)

This commit is contained in:
Yoyo Zhou
2018-01-31 12:04:27 -08:00
committed by Sheetal Nandi
parent 2b3d24374f
commit 5af4ae7bf0
+13 -11
View File
@@ -3,6 +3,8 @@
// Definitions by: Daniel Imrie-Situnayake <https://github.com/dansitu>, Bill <https://github.com/bkim54>, Michael Haan <https://github.com/sfrooster>, Amiram Korach <https://github.com/amiram>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
// # Classes
export class Client {
constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any);
@@ -88,24 +90,24 @@ export class Offset {
}
export class KeyedMessage {
constructor(key: string, message: string);
constructor(key: string, value: string | Buffer);
}
// # Interfaces
export interface Message {
topic: string;
value: string;
offset?: number;
partition?: number;
highWaterOffset?: number;
key?: string;
}
topic: string;
value: string | Buffer;
offset?: number;
partition?: number;
highWaterOffset?: number;
key?: string;
}
export interface ProducerOptions {
requireAcks?: number;
ackTimeoutMs?: number;
partitionerType?: number;
requireAcks?: number;
ackTimeoutMs?: number;
partitionerType?: number;
}
export interface KafkaClientOptions {