1.0.103 • Published 7 years ago

@springworks/sqs-processor v1.0.103

Weekly downloads
90
License
MIT
Repository
github
Last release
7 years ago

sqs-processor

Greenkeeper badge

Module for SQS queue processing

API

exports.create(iterator, config, logger)

Params

pathtypepresencedescription
iteratorfunctionrequiredA function that handles a single queue message. See Iterator below.
configobjectrequiredSee Module config below.
loggerBunyanrequiredBunyan 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

pathtypepresencedescriptiondefaultconformsunitvalidsinvalids
-objectrequiredModule config
queue_namestringrequiredName of the SQS queue""
regionstringoptionalAWS region"eu-west-1"""
api_versionstringoptionalAWS SQS API version"2012-11-05"""
batch_timeoutnumberoptionalTimeout after which a new batch will be forced to start60000integer, min: 0milliseconds
batch_force_thresholdnumberoptionalAn error is emitted if batches timeout this many times in a row5integer, min: 0
visibility_timeoutnumberoptionalThe visibility timeout for the queue30integer, min: 0, max: 43200seconds
wait_time_secondsnumberoptionalLong-polling timeout (0 = short-polling)20integer, min: 0seconds
max_nof_messagesnumberoptionalMax messages to receive per request10integer, min: 1, max: 10
attribute_namesarrayoptionalAttributes to be returned along with each message["All"]
attribute_names+0stringoptional"All" "ApproximateFirstReceiveTimestamp" "ApproximateReceiveCount" "SenderId" "SentTimestamp"""

Returned object

The create function returns an object with the following methods: startProcessingQueue and 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 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 until the current batch is depleted but will not fetch a new batch. Takes no arguments and return nothing.

1.0.103

7 years ago

1.0.102

7 years ago

1.0.101

7 years ago

1.0.100

7 years ago

1.0.99

7 years ago

1.0.98

7 years ago

1.0.97

7 years ago

1.0.96

7 years ago

1.0.95

7 years ago

1.0.94

7 years ago

1.0.93

7 years ago

1.0.92

7 years ago

1.0.91

7 years ago

1.0.90

8 years ago

1.0.89

8 years ago

1.0.88

8 years ago

1.0.87

8 years ago

1.0.86

8 years ago

1.0.85

8 years ago

1.0.84

8 years ago

1.0.83

8 years ago

1.0.82

8 years ago

1.0.81

8 years ago

1.0.80

8 years ago

1.0.79

8 years ago

1.0.78

8 years ago

1.0.77

8 years ago

1.0.76

8 years ago

1.0.75

8 years ago

1.0.74

8 years ago

1.0.73

8 years ago

1.0.72

8 years ago

1.0.71

8 years ago

1.0.70

8 years ago

1.0.69

8 years ago

1.0.68

8 years ago

1.0.67

8 years ago

1.0.66

8 years ago

1.0.65

8 years ago

1.0.64

8 years ago

1.0.63

8 years ago

1.0.62

8 years ago

1.0.61

8 years ago

1.0.60

8 years ago

1.0.59

8 years ago

1.0.58

8 years ago

1.0.57

8 years ago

1.0.56

8 years ago

1.0.55

8 years ago

1.0.54

8 years ago

1.0.53

8 years ago

1.0.52

8 years ago

1.0.51

8 years ago

1.0.50

8 years ago

1.0.49

8 years ago

1.0.48

8 years ago

1.0.47

8 years ago

1.0.46

8 years ago

1.0.45

8 years ago

1.0.44

8 years ago

1.0.43

8 years ago

1.0.42

8 years ago

1.0.41

8 years ago

1.0.40

8 years ago

1.0.39

8 years ago

1.0.38

8 years ago

1.0.37

8 years ago

1.0.36

8 years ago

1.0.35

8 years ago

1.0.34

8 years ago

1.0.33

8 years ago

1.0.32

8 years ago

1.0.31

8 years ago

1.0.30

8 years ago

1.0.29

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago