我正在尝试使用标准 SQS 调用 lambda 函数。我已经使用 try-catch 块处理了错误,每当捕获到错误时,就会返回该错误。否则,将返回 200 OK 响应消息。
我想重新处理返回错误的消息。但 lambda 不会重新处理这些消息。即使保留时间段(5 分钟)> 可见性超时(1 分钟) 为什么会发生这种情况?
const { spawnSync, execSync } = require('child_process');
const fs = require('fs');
const { S3Client, GetObjectCommand, PutObjectCommand } = require("@aws-sdk/client-s3");
const { DynamoDBClient, UpdateItemCommand } = require("@aws-sdk/client-dynamodb");
const { marshall } = require('@aws-sdk/util-dynamodb');
exports.lambdaHandler = async (event) => {
try {
const body = JSON.parse(event["Records"][0]['body']);
try {
// Code base 1
// All the above imported dependencies will be used here
const response = …Run Code Online (Sandbox Code Playgroud)