Created
June 5, 2021 01:51
-
-
Save mosufy/3ccccf91c2bcea1a37a42827762e7b3d to your computer and use it in GitHub Desktop.
This file contains 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
import { SQS } from 'aws-sdk'; | |
export const sendQueue = async (payload, options) => { | |
const sqs = new SQS(options); | |
try { | |
await sqs.sendMessage(payload).promise(); | |
return 'messageSent'; | |
} catch (error) { | |
throw new Error('Failed to send message'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment