sqs-producer
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -78,2 +78,18 @@ 'use strict'; | ||
if (message.groupId) { | ||
if (typeof message.groupId !== 'string') { | ||
throw new Error('Message.groupId value must be a string'); | ||
} | ||
entry.MessageGroupId = message.groupId; | ||
} | ||
if (message.deduplicationId) { | ||
if (typeof message.deduplicationId !== 'string') { | ||
throw new Error('Message.deduplicationId value must be a string'); | ||
} | ||
entry.MessageDeduplicationId = message.deduplicationId; | ||
} | ||
return entry; | ||
@@ -80,0 +96,0 @@ } |
{ | ||
"name": "sqs-producer", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Enqueues messages onto a given SQS queue", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -64,2 +64,18 @@ sqs-producer | ||
// send a message to a FIFO queue | ||
// | ||
// note that AWS FIFO queues require two additional params: | ||
// - groupId (string) | ||
// - deduplicationId (string) | ||
// | ||
// deduplicationId can be excluded if content-based deduplication is enabled | ||
// | ||
// http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html | ||
producer.send({ | ||
body: 'Hello world from our FIFO queue!', | ||
groupId: 'group1234', | ||
deduplicationId: 'abcdef123456' // typically a hash of the message body | ||
}, function(err) { | ||
if (err) console.log(err); | ||
}); | ||
``` | ||
@@ -66,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9512
141
101