Last active
May 11, 2023 16:24
-
-
Save onlybakam/d5cca042f49282a0db68ed2cebfa08b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function sqsSendMessage(queueUrl: string, msg: unknown, groupId: string, dedupId: string) { | |
const bodyJson = { | |
Action: 'SendMessage', | |
MessageBody: JSON.stringify(msg), | |
QueueUrl: queueUrl, | |
MessageDeduplicationId: dedupId, | |
MessageGroupId: groupId, | |
} | |
const req: HTTPRequest = { | |
method: 'POST', | |
resourcePath: '/', | |
params: { | |
body: JSON.stringify(bodyJson), | |
headers: { | |
'X-Amz-Target': 'AmazonSQS.SendMessage', | |
'Content-Type': 'application/x-amz-json-1.0', | |
}, | |
}, | |
} | |
log('sending to sqs:', req) | |
return req | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment