How to use the sqs-consumer.default.create function in sqs-consumer

To help you get started, we’ve selected a few sqs-consumer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zotoio / github-task-manager / src / agent / Agent.js View on Github external
AgentUtils.getQueueUrl(process.env.GTM_SQS_PENDING_QUEUE).then(function(data) {
            pendingUrl = data;
            systemConfig.pendingQueue = {};
            systemConfig.pendingQueue.url = pendingUrl;

            pendingQueueHandler = Consumer.create({
                queueUrl: pendingUrl,
                region: process.env.GTM_AWS_REGION,
                messageAttributeNames: Event.requiredAttributes,

                handleMessage: async (message, done) => {
                    let startTime = new Date().getTime();
                    log.info('## == NEW EVENT ==================================');
                    log.info('Received Message from Pending Queue');
                    log.debug(`message: ${json.plain(message)}`);

                    let event;
                    try {
                        event = new Event(message);
                    } catch (e) {
                        log.error(e);
                        done(); //todo dead letter queue here rather than discard
github zotoio / github-task-manager / src / agent / Agent.js View on Github external
AgentUtils.getQueueUrl(process.env.GTM_SQS_PENDING_QUEUE).then(function(data) {
            pendingUrl = data;
            systemConfig.pendingQueue = {};
            systemConfig.pendingQueue.url = pendingUrl;

            pendingQueueHandler = Consumer.create({
                queueUrl: pendingUrl,
                region: process.env.GTM_AWS_REGION,
                messageAttributeNames: Event.requiredAttributes,

                handleMessage: async (message, done) => {
                    log.info('## == NEW EVENT ==================================');
                    log.info('Received Message from Pending Queue');
                    log.debug(`message: ${json.plain(message)}`);

                    let event;
                    try {
                        event = new Event(message);
                    } catch (e) {
                        log.error(e);
                        done(); //todo dead letter queue here rather than discard
                        return;

sqs-consumer

Build SQS-based Node applications without the boilerplate

Apache-2.0
Latest version published 25 days ago

Package Health Score

92 / 100
Full package analysis