1 unstable release
0.1.1 | Dec 19, 2020 |
---|
#8 in #sqs
17KB
149 lines
sqsmv
STATUS: alpha
Table of Contents
Description
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
Installation Options
Download the binary
- 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
Usage
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'
Errors
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
Development
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'
Dependencies
~20MB
~362K SLoC