Skip to content

Instantly share code, notes, and snippets.

@cosminonea
Last active August 29, 2015 14:17
Show Gist options
  • Save cosminonea/9d8da692377941843fe8 to your computer and use it in GitHub Desktop.
Save cosminonea/9d8da692377941843fe8 to your computer and use it in GitHub Desktop.
AWS SQS - republish failed messages from error queue
Receive-SQSMessage -Region eu-west-1 `
-QueueUrl $error-queue-url `
-MaxNumberOfMessages 10 |
ForEach-Object { `
Send-SQSMessage -Region eu-west-1 `
-QueueUrl $queue-url `
-MessageBody $_.Body `
-MessageAttributes $_.Attributes
Remove-SQSMessage -Region eu-west-1 `
-QueueUrl $error-queue-url `
-ReceiptHandle $_.ReceiptHandle -Force
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment