@springworks/sqs-processor

Module for SQS queue processing

Use @springworks/sqs-poller
Last updated 3 years ago by springworks .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @springworks/sqs-processor 
SYNC missed versions from official npm registry.

sqs-processor

Greenkeeper badge

Module for SQS queue processing

API

exports.create(iterator, config, logger)

Params

path type presence description
iterator function required A function that handles a single queue message. See [Iterator][iterator] below.
config object required See [Module config][module-config] below.
logger Bunyan required Bunyan logger instance.

Iterator

The function passed as the first argument to create is intended to implement the handling of queued messages. It will be applied to each message as they are fetched from the queue. The iterator is also passed a callback(err) which must be called once it has completed. If no error has occurred, the callback should be run without arguments or with an explicit null argument.

Module config

path type presence description default conforms unit valids invalids
- object required Module config
queue_name string required Name of the SQS queue ""
region string optional AWS region "eu-west-1" ""
api_version string optional AWS SQS API version "2012-11-05" ""
batch_timeout number optional Timeout after which a new batch will be forced to start 60000 integer, min: 0 milliseconds
batch_force_threshold number optional An error is emitted if batches timeout this many times in a row 5 integer, min: 0
visibility_timeout number optional The visibility timeout for the queue 30 integer, min: 0, max: 43200 seconds
wait_time_seconds number optional Long-polling timeout (0 = short-polling) 20 integer, min: 0 seconds
max_nof_messages number optional Max messages to receive per request 10 integer, min: 1, max: 10
attribute_names array optional Attributes to be returned along with each message ["All"]
attribute_names[+0] string optional "All" "ApproximateFirstReceiveTimestamp" "ApproximateReceiveCount" "SenderId" "SentTimestamp" ""

Returned object

The create function returns an object with the following methods: [startProcessingQueue][startprocessingqueue] and [stopAfterCurrentBatch][stopaftercurrentbatch].

Events

The returned object from create is also an event emitter and may emit the following events:

  • error The error event is emitted if the [iterator][iterator] times out config.batch_force_threshold number of times.

startProcessingQueue()

Start processing queue. Takes no arguments and return nothing.

stopAfterCurrentBatch()

Stop processing queue after the current message batch is done. The module will keep calling the [iterator][iterator] until the current batch is depleted but will not fetch a new batch. Takes no arguments and return nothing.

Current Tags

  • 1.0.103                                ...           latest (3 years ago)

101 Versions

  • 1.0.103 [deprecated]           ...           3 years ago
  • 1.0.102 [deprecated]           ...           3 years ago
  • 1.0.101 [deprecated]           ...           3 years ago
  • 1.0.100 [deprecated]           ...           3 years ago
  • 1.0.99 [deprecated]           ...           3 years ago
  • 1.0.98 [deprecated]           ...           3 years ago
  • 1.0.97 [deprecated]           ...           3 years ago
  • 1.0.96 [deprecated]           ...           4 years ago
  • 1.0.95 [deprecated]           ...           4 years ago
  • 1.0.94 [deprecated]           ...           4 years ago
  • 1.0.93 [deprecated]           ...           4 years ago
  • 1.0.92 [deprecated]           ...           4 years ago
  • 1.0.91 [deprecated]           ...           4 years ago
  • 1.0.90 [deprecated]           ...           4 years ago
  • 1.0.89 [deprecated]           ...           4 years ago
  • 1.0.88 [deprecated]           ...           4 years ago
  • 1.0.87 [deprecated]           ...           4 years ago
  • 1.0.86 [deprecated]           ...           4 years ago
  • 1.0.85 [deprecated]           ...           4 years ago
  • 1.0.84 [deprecated]           ...           4 years ago
  • 1.0.83 [deprecated]           ...           4 years ago
  • 1.0.82 [deprecated]           ...           4 years ago
  • 1.0.81 [deprecated]           ...           4 years ago
  • 1.0.80 [deprecated]           ...           4 years ago
  • 1.0.79 [deprecated]           ...           4 years ago
  • 1.0.78 [deprecated]           ...           4 years ago
  • 1.0.77 [deprecated]           ...           4 years ago
  • 1.0.76 [deprecated]           ...           4 years ago
  • 1.0.75 [deprecated]           ...           4 years ago
  • 1.0.74 [deprecated]           ...           4 years ago
  • 1.0.73 [deprecated]           ...           4 years ago
  • 1.0.72 [deprecated]           ...           4 years ago
  • 1.0.71 [deprecated]           ...           4 years ago
  • 1.0.70 [deprecated]           ...           4 years ago
  • 1.0.69 [deprecated]           ...           4 years ago
  • 1.0.68 [deprecated]           ...           4 years ago
  • 1.0.67 [deprecated]           ...           4 years ago
  • 1.0.66 [deprecated]           ...           4 years ago
  • 1.0.65 [deprecated]           ...           4 years ago
  • 1.0.64 [deprecated]           ...           4 years ago
  • 1.0.63 [deprecated]           ...           4 years ago
  • 1.0.62 [deprecated]           ...           4 years ago
  • 1.0.61 [deprecated]           ...           4 years ago
  • 1.0.60 [deprecated]           ...           4 years ago
  • 1.0.59 [deprecated]           ...           4 years ago
  • 1.0.58 [deprecated]           ...           4 years ago
  • 1.0.57 [deprecated]           ...           4 years ago
  • 1.0.56 [deprecated]           ...           4 years ago
  • 1.0.55 [deprecated]           ...           4 years ago
  • 1.0.54 [deprecated]           ...           4 years ago
  • 1.0.53 [deprecated]           ...           4 years ago
  • 1.0.52 [deprecated]           ...           4 years ago
  • 1.0.51 [deprecated]           ...           4 years ago
  • 1.0.50 [deprecated]           ...           4 years ago
  • 1.0.49 [deprecated]           ...           4 years ago
  • 1.0.48 [deprecated]           ...           4 years ago
  • 1.0.47 [deprecated]           ...           4 years ago
  • 1.0.46 [deprecated]           ...           4 years ago
  • 1.0.45 [deprecated]           ...           4 years ago
  • 1.0.44 [deprecated]           ...           4 years ago
  • 1.0.43 [deprecated]           ...           4 years ago
  • 1.0.42 [deprecated]           ...           4 years ago
  • 1.0.41 [deprecated]           ...           4 years ago
  • 1.0.40 [deprecated]           ...           4 years ago
  • 1.0.39 [deprecated]           ...           4 years ago
  • 1.0.38 [deprecated]           ...           4 years ago
  • 1.0.37 [deprecated]           ...           4 years ago
  • 1.0.36 [deprecated]           ...           4 years ago
  • 1.0.35 [deprecated]           ...           4 years ago
  • 1.0.34 [deprecated]           ...           4 years ago
  • 1.0.33 [deprecated]           ...           4 years ago
  • 1.0.32 [deprecated]           ...           4 years ago
  • 1.0.31 [deprecated]           ...           4 years ago
  • 1.0.30 [deprecated]           ...           4 years ago
  • 1.0.29 [deprecated]           ...           4 years ago
  • 1.0.28 [deprecated]           ...           4 years ago
  • 1.0.27 [deprecated]           ...           4 years ago
  • 1.0.26 [deprecated]           ...           4 years ago
  • 1.0.25 [deprecated]           ...           4 years ago
  • 1.0.24 [deprecated]           ...           4 years ago
  • 1.0.23 [deprecated]           ...           4 years ago
  • 1.0.22 [deprecated]           ...           4 years ago
  • 1.0.21 [deprecated]           ...           4 years ago
  • 1.0.20 [deprecated]           ...           4 years ago
  • 1.0.19 [deprecated]           ...           4 years ago
  • 1.0.18 [deprecated]           ...           4 years ago
  • 1.0.17 [deprecated]           ...           4 years ago
  • 1.0.16 [deprecated]           ...           4 years ago
  • 1.0.15 [deprecated]           ...           4 years ago
  • 1.0.14 [deprecated]           ...           5 years ago
  • 1.0.13 [deprecated]           ...           5 years ago
  • 1.0.12 [deprecated]           ...           5 years ago
  • 1.0.11 [deprecated]           ...           5 years ago
  • 1.0.10 [deprecated]           ...           5 years ago
  • 1.0.9 [deprecated]           ...           5 years ago
  • 1.0.8 [deprecated]           ...           5 years ago
  • 1.0.7 [deprecated]           ...           5 years ago
  • 1.0.6 [deprecated]           ...           5 years ago
  • 1.0.5 [deprecated]           ...           5 years ago
  • 1.0.4 [deprecated]           ...           5 years ago
  • 1.0.3 [deprecated]           ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |