mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(microservices): no messages emitted with mqtt when qos set #14079
This commit is contained in:
@@ -210,15 +210,22 @@ export class ClientMqtt extends ClientProxy {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
...requestOptions,
|
||||
properties: {
|
||||
...requestOptions?.properties,
|
||||
// Cant just spread objects as MQTT won't deliver
|
||||
// any message with empty object as "userProperties" field
|
||||
// @url https://github.com/nestjs/nest/issues/14079
|
||||
let options: MqttRecordOptions = {};
|
||||
if (requestOptions) {
|
||||
options = { ...requestOptions };
|
||||
}
|
||||
if (this.options?.userProperties) {
|
||||
options.properties = {
|
||||
...options.properties,
|
||||
userProperties: {
|
||||
...this.options?.userProperties,
|
||||
...requestOptions?.properties?.userProperties,
|
||||
...options.properties?.userProperties,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user