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

@@ -28,6 +28,7 @@ let mqttPackage: any = {};
export class ServerMqtt extends Server implements CustomTransportStrategy {
private readonly url: string;
private mqttClient: MqttClient;
public readonly transportId: Transport = Transport.MQTT;
constructor(private readonly options: MqttOptions['options']) {
super();
@@ -41,10 +42,6 @@ export class ServerMqtt extends Server implements CustomTransportStrategy {
this.initializeDeserializer(options);
}
public getTransport(): number {
return Transport.MQTT;
}
public async listen(callback: () => void) {
this.mqttClient = this.createMqttClient();
this.start(callback);