sb-rabbitmq-provider 1.0.16 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -15,6 +15,7 @@ interface rabbitMQConfig {
|
|
15
15
|
vhost?: string | undefined;
|
16
16
|
exchangeName?: string;
|
17
17
|
exchangeType: string;
|
18
|
+
publishOptions?: Record<string, string> | undefined;
|
18
19
|
}
|
19
20
|
type MyCallback = (data: any) => any;
|
20
21
|
declare class RabbitMqConnection {
|
@@ -22,6 +23,7 @@ declare class RabbitMqConnection {
|
|
22
23
|
exchange: string;
|
23
24
|
exchangeType: string;
|
24
25
|
connection: any;
|
26
|
+
publishOptions: Options.Publish | undefined;
|
25
27
|
/**
|
26
28
|
* constructor for initialising url, exchange name, exchange type
|
27
29
|
* @param url rabbitmq url
|
package/dist/index.js
CHANGED
@@ -33,6 +33,7 @@ class RabbitMqConnection {
|
|
33
33
|
if (config.exchangeType && typeof config.exchangeType === 'string') {
|
34
34
|
this.exchangeType = config.exchangeType;
|
35
35
|
}
|
36
|
+
this.publishOptions = config.publishOptions || undefined;
|
36
37
|
this.config = config;
|
37
38
|
}
|
38
39
|
/**
|
@@ -80,7 +81,7 @@ class RabbitMqConnection {
|
|
80
81
|
return __awaiter(this, void 0, void 0, function* () {
|
81
82
|
try {
|
82
83
|
const bufferMessage = Buffer.from(JSON.stringify(message));
|
83
|
-
channel.publish(this.exchange, queueName, bufferMessage);
|
84
|
+
channel.publish(this.exchange, queueName, bufferMessage, this.publishOptions);
|
84
85
|
return { status: true, message: 'Data sent to Queue' };
|
85
86
|
}
|
86
87
|
catch (error) {
|