|
@@ -27,7 +27,7 @@ class RabbitmqnewService extends Service {
|
|
|
}
|
|
|
|
|
|
// 发送消息
|
|
|
- async sendQueueMsg(queueName, routeKey, msg) {
|
|
|
+ async sendQueueMsg(queueName, routeKey, msg, sendCallBack) {
|
|
|
const self = this;
|
|
|
const conn = await amqp.connect(self.hosts[self.index]);
|
|
|
const ch = await conn.createConfirmChannel();
|
|
@@ -40,8 +40,10 @@ class RabbitmqnewService extends Service {
|
|
|
console.log('==result==', result);
|
|
|
if (result) {
|
|
|
console.log('发送成功');
|
|
|
+ sendCallBack && sendCallBack(true);
|
|
|
} else {
|
|
|
console.log('发送失败');
|
|
|
+ sendCallBack && sendCallBack(false);
|
|
|
}
|
|
|
await ch.close();
|
|
|
} catch (e) {
|