Class

SQSService

SQSService(sqsClient)

Constructor

# new SQSService(sqsClient)

Creates an instance of SQSService.

Parameters:
Name Type Description
sqsClient AWS.SQS

An instance of AWS.SQS

View Source src/aws/sqs/SQSService.js, line 22

Methods

# async countMessages(queueUrl) → {Promise.<number>}

Count the approximate number of messages in the specified SQS queue.

Parameters:
Name Type Description
queueUrl string

The URL of the SQS queue.

View Source src/aws/sqs/SQSService.js, line 109

  • The approximate number of messages.
Promise.<number>

# async deleteMessage(queueUrl, receiptHandle) → {Promise.<Object>}

Delete a message from the specified SQS queue.

Parameters:
Name Type Description
queueUrl string

The URL of the SQS queue.

receiptHandle string

The receipt handle of the message to delete.

View Source src/aws/sqs/SQSService.js, line 87

  • The result from SQS.
Promise.<Object>

# async purgeQueue(queueUrl) → {Promise.<Object>}

Purge all messages from the specified SQS queue.

Parameters:
Name Type Description
queueUrl string

The URL of the SQS queue.

View Source src/aws/sqs/SQSService.js, line 133

  • The result from SQS.
Promise.<Object>

# async receiveMessages(queueUrl, maxNumberOfMessagesopt) → {Promise.<Array>}

Receive messages from the specified SQS queue.

Parameters:
Name Type Attributes Default Description
queueUrl string

The URL of the SQS queue.

maxNumberOfMessages number <optional>
1

Max number of messages to retrieve.

View Source src/aws/sqs/SQSService.js, line 63

  • Array of messages received.
Promise.<Array>

# async sendMessage(queueUrl, messageBody) → {Promise.<Object>}

Send a message to the specified SQS queue.

Parameters:
Name Type Description
queueUrl string

The URL of the SQS queue.

messageBody Object

The message body to send.

View Source src/aws/sqs/SQSService.js, line 40

  • The result from SQS.
Promise.<Object>