mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(microservices): move getTransportId functions to public variable transportId and make it optional
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user