Skip to content

Commit 06fc57b

Browse files
beemanTom Kirkpatrick
authored and
Tom Kirkpatrick
committed
fix: create Queue model on memory ds when rabbit ds is not found
1 parent 1a1b496 commit 06fc57b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const _ = require('lodash')
44
const debug = require('debug')('loopback:component:mq')
5+
const loopback = require('loopback')
56
const setupModel = require('./setup-model')
67
const Rabbit = require('./rabbit')
78
let rabbit = null
@@ -90,6 +91,9 @@ module.exports = function loopbackComponentMq(app, config) {
9091
}
9192
else {
9293
debug(`DataSource ${options.dataSource} not found`)
94+
const memDs = loopback.createDataSource({ connector: 'memory' })
95+
96+
setupModel(app, memDs, {}, {})
9397
}
9498

9599
}

test/test-server/common/models/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function(Event) {
1010
if (Event.sendOutgoingMessage) {
1111
Event.sendOutgoingMessage(ctx.instance)
1212
} else {
13-
throw new Error('Method Event.sendOutgoingMessage does not exist')
13+
console.error('Method Event.sendOutgoingMessage does not exist')
1414
}
1515
next()
1616
})

0 commit comments

Comments
 (0)