@message-queue-toolkit/sns
Version:
SNS adapter for message-queue-toolkit
21 lines • 625 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.readSnsMessage = readSnsMessage;
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
;