@autofleet/rabbit 1.0.5 → 1.0.6
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.js +2 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -77,10 +77,12 @@ class RabbitMq {
|
|
|
77
77
|
}
|
|
78
78
|
async publish(exchange, content) {
|
|
79
79
|
const channel = await this.assertChannel();
|
|
80
|
+
await this.assertExchange(exchange);
|
|
80
81
|
return channel.publish(exchange, '', Buffer.from(content));
|
|
81
82
|
}
|
|
82
83
|
async sendToQueue(queue, content) {
|
|
83
84
|
const channel = await this.assertChannel();
|
|
85
|
+
await this.assertQueue(queue);
|
|
84
86
|
return channel.sendToQueue(queue, Buffer.from(content));
|
|
85
87
|
}
|
|
86
88
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -94,11 +94,13 @@ class RabbitMq {
|
|
|
94
94
|
|
|
95
95
|
async publish(exchange: string, content: any) {
|
|
96
96
|
const channel: Channel = await this.assertChannel();
|
|
97
|
+
await this.assertExchange(exchange);
|
|
97
98
|
return channel.publish(exchange, '', Buffer.from(content));
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
async sendToQueue(queue: string, content: any) {
|
|
101
102
|
const channel: Channel = await this.assertChannel();
|
|
103
|
+
await this.assertQueue(queue);
|
|
102
104
|
return channel.sendToQueue(queue, Buffer.from(content));
|
|
103
105
|
}
|
|
104
106
|
}
|