|
@@ -1,6 +1,5 @@
|
|
|
'use strict';
|
|
|
|
|
|
-const _ = require('lodash');
|
|
|
const Service = require('egg').Service;
|
|
|
|
|
|
class RabbitmqService extends Service {
|
|
@@ -26,6 +25,8 @@ class RabbitmqService extends Service {
|
|
|
async receiveQueueMsg(ex, routeKey, receiveCallBack) {
|
|
|
const self = this;
|
|
|
const { mq } = self.ctx;
|
|
|
+ console.log(mq);
|
|
|
+ console.log(self.exType);
|
|
|
if (mq) {
|
|
|
const ch = await mq.conn.createChannel();
|
|
|
try {
|
|
@@ -34,7 +35,7 @@ class RabbitmqService extends Service {
|
|
|
console.log('==q=', q);
|
|
|
|
|
|
await ch.bindQueue(q.queue, ex, routeKey);
|
|
|
- await ch.consume(q.queue, msg => {
|
|
|
+ ch.consume(q.queue, msg => {
|
|
|
console.log('收到消息: ', msg);
|
|
|
|
|
|
ch.ack(msg);
|