@azteam/rabbitmq-async 1.0.171 → 1.0.172
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/lib/RabbitMQAsync.js +5 -5
- package/package.json +1 -1
- package/src/RabbitMQAsync.js +5 -6
package/lib/RabbitMQAsync.js
CHANGED
|
@@ -163,14 +163,14 @@ var RabbitMQAsync = /*#__PURE__*/function () {
|
|
|
163
163
|
key: "parsePrefix",
|
|
164
164
|
value: function parsePrefix(name) {
|
|
165
165
|
var self = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
166
|
+
var newName = name;
|
|
166
167
|
if (self) {
|
|
167
|
-
|
|
168
|
-
name = "".concat(this.serverIp, "_").concat(name);
|
|
168
|
+
newName = "".concat(this.serverIp, "_").concat(newName);
|
|
169
169
|
}
|
|
170
170
|
if (this.prefix) {
|
|
171
|
-
|
|
171
|
+
newName = "".concat(this.prefix, ":").concat(newName);
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return newName;
|
|
174
174
|
}
|
|
175
175
|
}, {
|
|
176
176
|
key: "send",
|
|
@@ -399,7 +399,7 @@ var RabbitMQAsync = /*#__PURE__*/function () {
|
|
|
399
399
|
break;
|
|
400
400
|
case 16:
|
|
401
401
|
_context6.next = 18;
|
|
402
|
-
return messageQueue.send('RETRY', {
|
|
402
|
+
return messageQueue.send(messageQueue.parsePrefix('RETRY'), {
|
|
403
403
|
queueName: queueName,
|
|
404
404
|
data: data,
|
|
405
405
|
retry_time: new Date()
|
package/package.json
CHANGED
package/src/RabbitMQAsync.js
CHANGED
|
@@ -66,15 +66,14 @@ class RabbitMQAsync {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
parsePrefix(name, self = false) {
|
|
69
|
+
let newName = name;
|
|
69
70
|
if (self) {
|
|
70
|
-
|
|
71
|
-
name = `${this.serverIp}_${name}`;
|
|
71
|
+
newName = `${this.serverIp}_${newName}`;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
73
|
if (this.prefix) {
|
|
75
|
-
|
|
74
|
+
newName = `${this.prefix}:${newName}`;
|
|
76
75
|
}
|
|
77
|
-
return
|
|
76
|
+
return newName;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
async send(queueName, msg = {}, limit = 0) {
|
|
@@ -166,7 +165,7 @@ class RabbitMQAsync {
|
|
|
166
165
|
await messageQueue.send(queueName, data);
|
|
167
166
|
}
|
|
168
167
|
} else {
|
|
169
|
-
await messageQueue.send('RETRY', {
|
|
168
|
+
await messageQueue.send(messageQueue.parsePrefix('RETRY'), {
|
|
170
169
|
queueName,
|
|
171
170
|
data,
|
|
172
171
|
retry_time: new Date(),
|