How to use the sqs-consumer.Consumer.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 votinginfoproject / Metis / aws / sqs.js View on Github external
var createConsumer = function(queueUrl, handler) {
  var consumer = Consumer.create({
    queueUrl: queueUrl,
    handleMessage: handler,
    sqs: sqs

  consumer.on('error', (err) => {
    logger.error("Error consuming SQS message from queue:", queueUrl);

  consumer.on('processing_error', (err) => {
    logger.error("Error processing SQS message from queue:", queueUrl);

  consumer.on('timeout_error', (err) => {
github mozilla / fxa / packages / fxa-event-broker / lib / notificationProcessor.ts View on Github external
    private readonly logger: Logger,
    private readonly db: Datastore,
    private metrics: StatsD,
    private readonly capabilityService: ClientCapabilityService,
    private readonly webhookService: ClientWebhookService,
    private readonly pubsub: PubSub,
    private readonly topicPrefix: string,
    queueUrl: string,
    sqs: SQS
  ) { = Consumer.create({
      batchSize: 10,
      handleMessage: async (message: SQS.Message) => {
        return await this.handleMessage(message);
    });'error', err => {
      logger.error('consumerError', { err });
    });'processing_error', err => {
      logger.error('processingError', { err });


Build SQS-based Node applications without the boilerplate

Latest version published 26 days ago

Package Health Score

92 / 100
Full package analysis