Command-line tool that moves messages from one SQS queue into another queue e.g. replay dlq to non-dlq
It does so by:
- reading the "from" sqs queue in a batch of 1-10 messages
- writes to the target "to" queue in same batches ^
- deletes from the origin "from" queue messages of the batches ^
- repeats 1-3 until the origin queue is empty, an error occurs, or the max iterations (1m) is exceeded
- Download the v0.1.0-alpha binary for MacOx or Linux
- unzip it
- you may need to
chmod +x sqsmv
to give execute prives - run it!
- (Optionally) add it to your PATH somewhere
On Linux (prerequisite):apt-get install libssl-dev
On Mac & Linux:
- if you don't have cargo: install it
cargo install sqsmv
Assuming you have AWS Named Profiles set up and both queues are under the same subaccount, this is how to run sqsmv
from the command line ( also see sqsmv --help
).
AWS_PROFILE=my-profile \
sqsmv \
--from-q <FROM_SQS_QUEUE> \
--to-q <TO_SQS_QUEUE>
# e.g. it should look something like this:
AWS_PROFILE=profile11111111 \
sqsmv \
-f'https://sqs.us-east-1.amazonaws.com/11111111/my-queue-dlq' \
-t'https://sqs.us-east-1.amazonaws.com/11111111/my-queue'
This program is very conservative with errors right now.
- If any READs on the SQS fail, the program will exit, reporting the READ failure
- If any WRITEs fail, the program will exit, reporting WRITE failures
- If any DELETEs fail, the program will exit, reporting DELETE failures that user can then use to do any cleanup necessary
AWS profiles configured with role_arn
/source_profile
can not be resolved at this time. Only profiles configured simply with valid aws_access_key_id
/aws_secret_access_key
are supported at this time.
AWS_PROFILE=my-profile \
cargo run -- \
-f'https://sqs.us-east-1.amazonaws.com/<my-acct#>/my-queue-dlq' \
-t'https://sqs.us-east-1.amazonaws.com/<my-acct#>/my-queue'