@node-ts/bus-sqs
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -59,2 +59,12 @@ export interface SqsTransportConfiguration { | ||
/** | ||
* The visibility timeout for the queue, in seconds. Valid values: An integer from 0 to 43,200 (12 hours) | ||
* @default 30 | ||
*/ | ||
visibilityTimeout?: number; | ||
/** | ||
* The number of times a message is delivered to the source queue before being moved to the dead-letter queue | ||
* @default 10 | ||
*/ | ||
maxReceiveCount?: number; | ||
/** | ||
* A resolver function that maps a message name to an SNS topic. | ||
@@ -61,0 +71,0 @@ * @param messageName Name of the message to map |
@@ -12,3 +12,4 @@ "use strict"; | ||
exports.MAX_SQS_VISIBILITY_TIMEOUT_SECONDS = 43200; | ||
const MAX_RETRY_COUNT = 10; | ||
const DEFAULT_VISIBILITY_TIMEOUT = 30; | ||
const DEFAULT_MAX_RETRY_COUNT = 10; | ||
const MILLISECONDS_IN_SECONDS = 1000; | ||
@@ -118,4 +119,5 @@ /** | ||
const serviceQueueAttributes = { | ||
VisibilityTimeout: `${this.sqsConfiguration.visibilityTimeout || DEFAULT_VISIBILITY_TIMEOUT}`, | ||
RedrivePolicy: JSON.stringify({ | ||
maxReceiveCount: MAX_RETRY_COUNT, | ||
maxReceiveCount: this.sqsConfiguration.maxReceiveCount || DEFAULT_MAX_RETRY_COUNT, | ||
deadLetterTargetArn: this.sqsConfiguration.deadLetterQueueArn | ||
@@ -122,0 +124,0 @@ }) |
{ | ||
"name": "@node-ts/bus-sqs", | ||
"description": "An AWS SQS transport adapter for @node-ts/bus-core.", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"license": "MIT", | ||
@@ -60,3 +60,3 @@ "main": "./dist/index.js", | ||
], | ||
"gitHead": "73b0b9a89aa107f452ce31ffe25a84786aea77b9" | ||
"gitHead": "63566056027566b7b05c0bddbfd99fc4e4359dad" | ||
} |
@@ -66,2 +66,14 @@ export interface SqsTransportConfiguration { | ||
/** | ||
* The visibility timeout for the queue, in seconds. Valid values: An integer from 0 to 43,200 (12 hours) | ||
* @default 30 | ||
*/ | ||
visibilityTimeout?: number | ||
/** | ||
* The number of times a message is delivered to the source queue before being moved to the dead-letter queue | ||
* @default 10 | ||
*/ | ||
maxReceiveCount?: number | ||
/** | ||
* A resolver function that maps a message name to an SNS topic. | ||
@@ -68,0 +80,0 @@ * @param messageName Name of the message to map |
@@ -17,3 +17,4 @@ import { Command, Event, Message, MessageAttributes, MessageAttributeMap } from '@node-ts/bus-messages' | ||
const MAX_RETRY_COUNT = 10 | ||
const DEFAULT_VISIBILITY_TIMEOUT = 30 | ||
const DEFAULT_MAX_RETRY_COUNT = 10 | ||
const MILLISECONDS_IN_SECONDS = 1000 | ||
@@ -183,4 +184,5 @@ type Seconds = number | ||
const serviceQueueAttributes: QueueAttributeMap = { | ||
VisibilityTimeout: `${this.sqsConfiguration.visibilityTimeout || DEFAULT_VISIBILITY_TIMEOUT}`, | ||
RedrivePolicy: JSON.stringify({ | ||
maxReceiveCount: MAX_RETRY_COUNT, | ||
maxReceiveCount: this.sqsConfiguration.maxReceiveCount || DEFAULT_MAX_RETRY_COUNT, | ||
deadLetterTargetArn: this.sqsConfiguration.deadLetterQueueArn | ||
@@ -187,0 +189,0 @@ }) |
Sorry, the diff of this file is not supported yet
78442
1481