feat(microservices): move getTransportId functions to public variable transportId and make it optional

This commit is contained in:
alex
2020-05-16 15:22:15 +03:00
parent 0845dab3a3
commit e2c8f74f19
13 changed files with 16 additions and 37 deletions

View File

@@ -38,6 +38,7 @@ export class ServerKafka extends Server implements CustomTransportStrategy {
private readonly brokers: string[];
private readonly clientId: string;
private readonly groupId: string;
public readonly transportId: Transport = Transport.KAFKA;
constructor(private readonly options: KafkaOptions['options']) {
super();
@@ -63,10 +64,6 @@ export class ServerKafka extends Server implements CustomTransportStrategy {
this.initializeDeserializer(options);
}
public getTransport(): number {
return Transport.KAFKA;
}
public async listen(callback: () => void): Promise<void> {
this.client = this.createClient();
await this.start(callback);