Skip to content

joakimen/sqs.clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqs.clj

lint

Dealing with Amazon SQS queues using babashka.

Requirements

Features

  • list: List queues and their messages
  • redrive: Start a redrive-task from one or more DLQs to their origin queues

Install

Install using bbin

$ bbin install io.github.joakimen/sqs.clj
{:coords
 {:git/url "https://github.com/joakimen/sqs.clj.git",
  :git/sha "30778e70e6df96cfb7abbd098e774b6da29cce3c"},
 :lib io.github.joakimen/sqs.clj}

AWS Credentials

sqs.clj uses AWS credentials from the current shell session.

In order to run with different credentials, assume a different profile using something like aws-vault

Usage

Commands

View commands

$ sqs
Usage: sqs <command>

  sqs list     queues with messages (--all to include empty queues)
  sqs redrive  select one or more queues to redrive messages from (--all to redrive all)

List

List queues and their messages

$ sqs list
|---------------------------------+----------|
|              Queue              | Messages |
|---------------------------------+----------|
| dev-app1-queue1-dlq             | 62       |
| dev-app1-queue2-dlq             | 46       |
|---------------------------------+----------|

Redrive

Redrive messages from one or more dead-letter queues in parallel and returns their task handles

$ sqs redrive

# .. user selects one or more queues using fzf

|-----------------------------------------------------------------------+----------|
|                                    Url                                | Messages |
|-----------------------------------------------------------------------+----------|
| https://sqs.eu-west-1.amazonaws.com/123456789012/dev-app1-queue1-dlq  | 46       |
|-----------------------------------------------------------------------+----------|

Press Enter to continue or Ctrl-C to exit

# .. user presses Enter

[ {
  "arn" : "arn:aws:sqs:eu-west-1:123456789012:dev-app1-queue1-dlq",
  "url" : "https://sqs.eu-west-1.amazonaws.com/123456789012/dev-app1-queue1",
  "task-handle" : "uOJ0yXNrSWQiOiJlODE8FjE4MS0xMzJjLTQxZjYtODdmZS0yMzAwZTVlMWJmYjcaLCJzb3VyY2VBcm4iOiJhcm46YXdzOnNxczpldS13ZXN0LTE6ODQ5MTM4MjY3Mzg5OmV1cm9wcmlzLWRldi1xcm9kDWN0LWludGVybmFsLWRscSJ9"
} ]

About

Babashka CLI for dealing with SQS queues

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published