AWSSQS.jl

AWS SQS

https://github.com/samoconnor/AWSSQS.jl

SQS Queues

sqs_list_queues([::AWSConfig], prefix="")

Returns a list of ::AWSQueue.

for q in sqs_list_queues()
    println("$(sqs_name(q)) has ~$(sqs_count(q)) messages.")
end
AWSSQS.sqs_get_queueFunction.
sqs_get_queue([::AWSConfig], name)

Look up a queue by name. Returns ::AWSQueue.

q = sqs_get_queue("my-queue")
sqs_send_message(q, "my message")
sqs_create_queue([::AWSConfig], name; options...)

Create new queue with name. Returns ::AWSQueue.

options: VisibilityTimeout, MessageRetentionPeriod, DelaySeconds etc...

See SQS API Reference for detail.

q = sqs_create_queue("my-queue")
sqs_send_message(q, "my message")
AWSSQS.sqs_set_policyFunction.
sqs_set_policy(::AWSQueue, policy)

Set access policy for a queue.

sqs_delete_queue(::AWSQueue)

Delete a queue.

SQS Messages

sqs_send_message(::AWSQueue, message)

Send a message to a queue.

sqs_send_message_batch(::AWSQueue, messages)

Send a collection of messages to a queue.

sqs_receive_message(::AWSQueue)

Returns a Dict containing :message and :handle or nothing if the queue is empty.

m = sqs_receive_message(q)
println(m[:message])
sqs_delete_message(m)
AWSSQS.sqs_messagesFunction.
sqs_messages(::AWSQueue)

Returns an iterator that retrieves messages from a queue.

for m in sqs_messages(q)
    println(m[:message])
    sqs_delete_message(m)
end
sqs_delete_message(::AWSQueue, message)

Delete a message from a queue.

AWSSQS.sqs_flushFunction.
sqs_flush(::AWSQueue)

Delete all messages from a queue.

SQS Metadata

AWSSQS.sqs_nameFunction.
sqs_name(::AWSQueue)

Name of a queue.

AWSSQS.sqs_arnFunction.
sqs_arn(::AWSQueue)

ARN of a queue.

sqs_get_queue_attributes(::AWSQueue)

Get Queue Attributes for a queue.

AWSSQS.sqs_countFunction.
sqs_count(::AWSQueue)

Approximate number of messages in a queue.

AWSSQS.sqs_busy_countFunction.
sqs_busy_count(::AWSQueue)

Approximate number of messages not visible in a queue.