@flexfactory/message-utils
v2.1.1
Published
A utils library for rabbitmq message processing and publishing
Downloads
31
Readme
message-utils
Install
npm i --save @flexfactory/message-utils
Usage
Wrapping message handler function
const { handle } = require('@flexfactory/message-utils');
module.exports = [
{
queue: 'jobs.inv.update_room_type',
binding: 'events.int.room_type_updated',
handler: handle(Store.knex, require('./controllers/updateRoomType'), log),
},
...
];
Using models
const { OutboundMessage, ProcessedMessage } = require('@flexfactory/message-utils');
await OutboundMessage
.query(trx)
.insert({
key: '...',
body: {
...
},
});