@autofleet/rabbit 1.0.7 → 1.0.8
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 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -90,12 +90,12 @@ class RabbitMq {
|
|
|
90
90
|
async publish(exchange, content) {
|
|
91
91
|
const channel = await this.assertChannel();
|
|
92
92
|
await this.assertExchange(exchange);
|
|
93
|
-
return channel.publish(exchange, '', Buffer.from(content));
|
|
93
|
+
return channel.publish(exchange, '', Buffer.from(JSON.stringify(content)));
|
|
94
94
|
}
|
|
95
95
|
async sendToQueue(queue, content) {
|
|
96
96
|
const channel = await this.assertChannel();
|
|
97
97
|
await this.assertQueue(queue);
|
|
98
|
-
return channel.sendToQueue(queue, Buffer.from(content));
|
|
98
|
+
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
exports.default = RabbitMq;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -107,13 +107,13 @@ class RabbitMq {
|
|
|
107
107
|
async publish(exchange: string, content: any) {
|
|
108
108
|
const channel: Channel = await this.assertChannel();
|
|
109
109
|
await this.assertExchange(exchange);
|
|
110
|
-
return channel.publish(exchange, '', Buffer.from(content));
|
|
110
|
+
return channel.publish(exchange, '', Buffer.from(JSON.stringify(content)));
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
async sendToQueue(queue: string, content: any) {
|
|
114
114
|
const channel: Channel = await this.assertChannel();
|
|
115
115
|
await this.assertQueue(queue);
|
|
116
|
-
return channel.sendToQueue(queue, Buffer.from(content));
|
|
116
|
+
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|