A command line tool for interacting with AWS SQS queues :walking::walking::walking:
sqsc
is a command line tool for interacting with AWS SQS queues.
npm install -g sqsc
sqsc lq [queue-prefix]
sqsc ls <queue-name>
Options:
timeout
: Visibility timeout for messages received (Default = 30). You might need to increase this if the queue has a lot of messages to prevent reading the same message.timestamp
: Display timestamp.limit
: Maximum number of messages to list.sqsc cp <from-queue-name> <to-queue-name>
sqsc mv <from-queue-name> <to-queue-name>
Options:
timeout
: Visibility timeout for messages received (Default = 30).sqsc describe <queue-name>
sqsc query "SELECT body FROM <queue-name> WHERE body LIKE '%user%'"
sqsc pull <queue-name>
to store messages in local sqlite database.Options:
timeout
: Visibility timeout for messages received (Default = 30).sqsc query <sql-query>
. Internally, sqsc
will try to guess the queue name in the SQL.Options:
hide-headers
: Do not show column headers. (Eg: you want to use body with JSON parser like jq
)sqsc list-table
.sqsc schema
.json_extract
function in sqlite
.
$ sqsc query "select json_extract(body, '$.gender') gender, count(*) from DevelopmentQueue group by 1"
GENDER COUNT(*)
Female 24
Male 26
visibility timeout
and max receive count
sqsc
, the visibility timeout
is set to 30s
by default. You can use the --timeout
parameter to change it.sqsc
keeps the receipt handle
for all messages to reset their visibility timeout
at the end of the command.sqsc
receive the same message more than once, it will only use the first message. (It checks message ID
)receive count
of message increases as usual for each receive. Message goes into dead letter queue
when it hits max receive count
.ls
mv
cp
pull
# Install dependencies
npm install
# Running tests
npm test
# Starting localstack
export TMPDIR=/private$TMPDIR # MacOS only
docker-compose up -d
# Populating queues and messages for Development
export LOCALSTACK=1
tsc -p .
bin/populate-dev.js