{ "type": "TYPE_1", "content": /* your message, can be any type (object, string, init, ...) */ }
const Router = require('queue-router').Router; const router = new Router(); router.add('TYPE_1', { handler: function(messageContent, attributes) { // Required // your handling code }, validation: { // Optional schema: // Joi schema, https://github.com/hapijs/joi } });
const workerFactory = require('queue-router').workerFactory; const worker = workerFactory.create(workerFactory.Types.SQS, router, config); worker.init().then(() => worker.start());
There was an error while loading. Please reload this page.