This package wraps the SQS Client - AWS SDK for JavaScript v3 to provide consistent logging and other services.
- WrappedSqsClient
- static
- .WrappedSqsClient
- new exports.WrappedSqsClient([options])
- instance
- .queueInitialized ⇒
boolean - .queueName ⇒
string - .queueUrl ⇒
string - .createQueue(queueName, [attributes], [tags]) ⇒
Promise.<WrappedSqsClient> - .deleteQueue() ⇒
Promise.<WrappedSqsClient> - .deleteMessageBatch(messages) ⇒
Promise.<WrappedSqsClient> - .getQueue(queueName) ⇒
Promise.<WrappedSqsClient> - .getQueueAttributes([attributeNames]) ⇒
Promise.<object> - .purgeQueue() ⇒
Promise.<WrappedSqsClient> - .queueExists(queueName) ⇒
Promise.<boolean> - .receiveMessages([options]) ⇒
Promise.<Array.<{messageId: string, body: any, attributes: Object.<string, string>}>> - .sendMessage(options) ⇒
Promise.<WrappedSqsClient> - .sendMessageBatch(entries) ⇒
Promise.<WrappedSqsClient>
- .queueInitialized ⇒
- static
- .decodeMessage([message]) ⇒
object - .decodeMessageAttributes(attributes) ⇒
DecodedMessageAttributes - .encodeMessageAttributes(attributes) ⇒
EncodedMessageAttributes
- .decodeMessage([message]) ⇒
- .WrappedSqsClient
- inner
- ~defaultClientConfig :
SQSClientConfig - ~DecodedMessageAttributes :
Object.<string, (string|number)> - ~EncodedMessageAttributes :
Object.<string, MessageAttributeValue> - ~SendMessageBatchRequestEntry :
object
- ~defaultClientConfig :
- static
Wraps an AWS SQS client to provide standard logging & services.
Kind: static class of WrappedSqsClient
- .WrappedSqsClient
- new exports.WrappedSqsClient([options])
- instance
- .queueInitialized ⇒
boolean - .queueName ⇒
string - .queueUrl ⇒
string - .createQueue(queueName, [attributes], [tags]) ⇒
Promise.<WrappedSqsClient> - .deleteQueue() ⇒
Promise.<WrappedSqsClient> - .deleteMessageBatch(messages) ⇒
Promise.<WrappedSqsClient> - .getQueue(queueName) ⇒
Promise.<WrappedSqsClient> - .getQueueAttributes([attributeNames]) ⇒
Promise.<object> - .purgeQueue() ⇒
Promise.<WrappedSqsClient> - .queueExists(queueName) ⇒
Promise.<boolean> - .receiveMessages([options]) ⇒
Promise.<Array.<{messageId: string, body: any, attributes: Object.<string, string>}>> - .sendMessage(options) ⇒
Promise.<WrappedSqsClient> - .sendMessageBatch(entries) ⇒
Promise.<WrappedSqsClient>
- .queueInitialized ⇒
- static
- .decodeMessage([message]) ⇒
object - .decodeMessageAttributes(attributes) ⇒
DecodedMessageAttributes - .encodeMessageAttributes(attributes) ⇒
EncodedMessageAttributes
- .decodeMessage([message]) ⇒
WrappedSqsClient constructor.
| Param | Type | Description |
|---|---|---|
| [options] | object |
Options. |
| [options.config] | SQSClientConfig |
SQSClientConfig. |
| [options.logger] | object |
Logger instance (default is global console object). Must have info, error & debug methods |
| [options.logInternals] | boolean |
Log AWS client internals (default is false). |
| [options.queueUrl] | string |
SQS queue URL. |
Returns true if queue has been initialized.
Kind: instance property of WrappedSqsClient
Returns: boolean - True if the queue has been initialized.
Gets queue name.
Kind: instance property of WrappedSqsClient
Returns: string - Queue name.
Gets the queue URL.
Kind: instance property of WrappedSqsClient
Returns: string - Queue URL.
Creates a new queue.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
| Param | Type | Description |
|---|---|---|
| queueName | string |
Queue name |
| [attributes] | Object.<string, string> |
CreateQueueCommandInput attributes |
| [tags] | Object.<string, string> |
CreateQueueCommandInput tags |
Deletes a queue.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
Deletes a message batch.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
| Param | Type | Description |
|---|---|---|
| messages | Array.<object> |
Messages to delete. |
Get existing queue by name.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
| Param | Type | Description |
|---|---|---|
| queueName | string |
Queue name. |
Get queue attributes.
Kind: instance method of WrappedSqsClient
Returns: Promise.<object> - Queue attributes.
| Param | Type | Description |
|---|---|---|
| [attributeNames] | Array.<string> |
GetQueueAttributesCommand |
Purge queue.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
Test queue existence by name.
Kind: instance method of WrappedSqsClient
Returns: Promise.<boolean> - True if queue exists.
| Param | Type | Description |
|---|---|---|
| queueName | string |
Queue name. |
wrappedSqsClient.receiveMessages([options]) ⇒ Promise.<Array.<{messageId: string, body: any, attributes: Object.<string, string>}>>
Receive queue messages.
Kind: instance method of WrappedSqsClient
Returns: Promise.<Array.<{messageId: string, body: any, attributes: Object.<string, string>}>> - Array of messages.
| Param | Type | Description |
|---|---|---|
| [options] | object |
Options. |
| [options.limit] | number |
Maximum number of messages to receive. |
Sends a message.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
| Param | Type | Description |
|---|---|---|
| options | object |
Options. |
| options.body | * |
SendMessageCommandInput messageBody. Must be a string or a JSON-serializable object. |
| [options.deduplicationId] | string |
SendMessageCommandInput messageDeduplicationId |
| [options.delaySeconds] | number |
Delay in seconds. |
| [options.groupId] | string |
SendMessageCommandInput messageGroupId |
| [options.messageAttributes] | DecodedMessageAttributes |
Message attributes. |
| [options.systemAttributes] | DecodedMessageAttributes |
SendMessageCommandInput messageSystemAttributes |
Sends a message batch.
Kind: instance method of WrappedSqsClient
Returns: Promise.<WrappedSqsClient> - WrappedSqsClient instance.
| Param | Type | Description |
|---|---|---|
| entries | Array.<SendMessageBatchRequestEntry> |
Entries. |
Decode message from SQS.
Kind: static method of WrappedSqsClient
Returns: object - Decoded message.
| Param | Type | Description |
|---|---|---|
| [message] | object |
Encoded message. |
Decode message attributes from SQS.
Kind: static method of WrappedSqsClient
Returns: DecodedMessageAttributes - Decoded message attributes.
| Param | Type | Description |
|---|---|---|
| attributes | EncodedMessageAttributes |
Encoded message attributes. |
Encode message attributes for SQS.
Kind: static method of WrappedSqsClient
Returns: EncodedMessageAttributes - Encoded message attributes.
| Param | Type | Description |
|---|---|---|
| attributes | DecodedMessageAttributes |
Decoded message attributes. |
Kind: inner constant of WrappedSqsClient
Kind: inner typedef of WrappedSqsClient
Kind: inner typedef of WrappedSqsClient
Kind: inner typedef of WrappedSqsClient
Properties
| Name | Type | Description |
|---|---|---|
| body | * |
SendMessageCommandInput messageBody. Must be a string or a JSON-serializable object. |
| [deduplicationId] | string |
SendMessageCommandInput messageDeduplicationId |
| [delaySeconds] | number |
Delay in seconds. |
| [groupId] | string |
SendMessageCommandInput messageGroupId |
| id | string |
Message ID. |
| [messageAttributes] | DecodedMessageAttributes |
Message attributes. |
| [systemAttributes] | DecodedMessageAttributes |
SendMessageCommandInput messageSystemAttributes |
Built with ❤️ on Bali! Find more great tools & templates on my GitHub Profile.