@message-queue-toolkit/sns
Version:
SNS adapter for message-queue-toolkit
18 lines • 514 B
JavaScript
export function readSnsMessage(message, errorProcessor) {
try {
const snsMessage = JSON.parse(message.Body);
const messagePayload = JSON.parse(snsMessage.Message);
return {
result: {
body: messagePayload,
attributes: snsMessage.MessageAttributes,
},
};
}
catch (exception) {
return {
error: errorProcessor.processError(exception),
};
}
}
//# sourceMappingURL=snsMessageReader.js.map