I have followed standard aws lambda creation with sqs trigger. Then I sent message to sqs queue which then kicks lambda, which in turn writes to stdout. All good.
The issue is: I have not yet deleted receipt of the message and I expect the message to appear again for processing after the visibility period of 60 seconds(default). This is not happening, wonder why.
package main
import (
"context"
"fmt"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
func handler(ctx context.Context, sqsEvent events.SQSEvent) error {
for _, message := range sqsEvent.Records {
fmt.Println("Id", message.MessageId)
fmt.Println("Source", message.EventSource)
fmt.Println("Body", message.Body)
}
return nil
}
func main() {
lambda.Start(handler)
}