Skip to content

Commit 30c8af7

Browse files
Pierre Maouigodu
authored andcommitted
MessageAttributes in camelCase
1 parent 70291c5 commit 30c8af7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/serverless-offline-sqs/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const {
99
has,
1010
isEmpty,
1111
isUndefined,
12+
lowerFirst,
1213
map,
14+
mapKeys,
1315
mapValues,
1416
omitBy,
1517
pipe
@@ -146,7 +148,7 @@ class ServerlessOfflineSQS {
146148
receiptHandle,
147149
body,
148150
attributes,
149-
messageAttributes,
151+
messageAttributes: mapValues(mapKeys(lowerFirst), messageAttributes),
150152
md5OfBody,
151153
eventSource: 'aws:sqs',
152154
eventSourceARN,

tests/serverless-plugins-integration/test-sqs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const sendMessages = () => {
1616
client
1717
.sendMessage({
1818
QueueUrl: 'http://localhost:9324/queue/MyFirstQueue',
19-
MessageBody: 'MyFirstMessage'
19+
MessageBody: 'MyFirstMessage',
20+
MessageAttributes: {
21+
myAttribute: {DataType: 'String', StringValue: 'myAttribute'}
22+
}
2023
})
2124
.promise(),
2225
client

0 commit comments

Comments
 (0)