Skip to content

Commit

Permalink
fix: create Queue model on memory ds when rabbit ds is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman authored and Tom Kirkpatrick committed Nov 23, 2016
1 parent 1a1b496 commit 06fc57b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const _ = require('lodash')
const debug = require('debug')('loopback:component:mq')
const loopback = require('loopback')
const setupModel = require('./setup-model')
const Rabbit = require('./rabbit')
let rabbit = null
Expand Down Expand Up @@ -90,6 +91,9 @@ module.exports = function loopbackComponentMq(app, config) {
}
else {
debug(`DataSource ${options.dataSource} not found`)
const memDs = loopback.createDataSource({ connector: 'memory' })

setupModel(app, memDs, {}, {})
}

}
2 changes: 1 addition & 1 deletion test/test-server/common/models/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(Event) {
if (Event.sendOutgoingMessage) {
Event.sendOutgoingMessage(ctx.instance)
} else {
throw new Error('Method Event.sendOutgoingMessage does not exist')
console.error('Method Event.sendOutgoingMessage does not exist')
}
next()
})
Expand Down

0 comments on commit 06fc57b

Please sign in to comment.