Liking cljdoc? Tell your friends :D

sqs-utils.core


handle-queueclj

(handle-queue sqs-config queue-url handler-fn)
(handle-queue sqs-config
              queue-url
              handler-fn
              {:keys [num-handler-threads auto-delete maximum-messages
                      num-consumers]
               :or {num-handler-threads 4
                    auto-delete true
                    maximum-messages 10
                    num-consumers 1}})

Set up a loop that listens to a queue and process incoming messages.

Arguments: sqs-config - A map of the following keys, used for interacting with SQS: access-key - AWS access key ID secret-key - AWS secret access key endpoint - SQS queue endpoint - usually an HTTPS based URL region - AWS region queue-url - URL of the queue handler-fn - a function which will be passed the incoming message. If auto-delete is false, a second argument will be passed a done function to call when finished processing. opts - an optional map containing the following keys: num-handler-threads - how many threads to run (defaults: 4)

auto-delete         - boolean, if true, immediately delete the message,
                      if false, forward a `done` function and leave the
                      message intact. (defaults: true)

maximum-messages    - the maximum number of messages to be delivered as
                      a result of a single poll of SQS.

num-consumers       - the number of polling requests to run concurrently.
                      (defaults: 1)

Returns: a kill function - call the function to terminate the loop.

Set up a loop that listens to a queue and process incoming messages.

 Arguments:
 sqs-config  - A map of the following keys, used for interacting with SQS:
    access-key - AWS access key ID
    secret-key - AWS secret access key
    endpoint   - SQS queue endpoint - usually an HTTPS based URL
    region     - AWS region
 queue-url  - URL of the queue
 handler-fn - a function which will be passed the incoming message. If
              auto-delete is false, a second argument will be passed a `done`
              function to call when finished processing.
 opts       - an optional map containing the following keys:
    num-handler-threads - how many threads to run (defaults: 4)

    auto-delete         - boolean, if true, immediately delete the message,
                          if false, forward a `done` function and leave the
                          message intact. (defaults: true)

    maximum-messages    - the maximum number of messages to be delivered as
                          a result of a single poll of SQS.

    num-consumers       - the number of polling requests to run concurrently.
                          (defaults: 1)

Returns:
a kill function - call the function to terminate the loop.
sourceraw docstring

receive-loop!clj

(receive-loop! sqs-config queue-url out-chan)
(receive-loop! sqs-config
               queue-url
               out-chan
               {:keys [auto-delete restart-delay-seconds maximum-messages
                       num-consumers]
                :or {auto-delete true
                     restart-delay-seconds 1
                     maximum-messages 10
                     num-consumers 1}
                :as opts})

A background loop to receive SQS messages from a queue indefinitely.

Arguments: sqs-config - A map of the following keys, used for interacting with SQS: access-key - AWS access key ID secret-key - AWS secret access key endpoint - SQS queue endpoint - usually an HTTPS based URL region - AWS region queue-url - URL of the queue out-chan - async channel where messages will be passed into opts - an optional map containing the following keys:

auto-delete           - boolean, if true, immediately delete the message,
                        if false, forward a `done` function and leave the
                        message intact. (default: true)

restart-delay-seconds - how long (in seconds) to wait before attempting to
                        restart the consumer loop.

maximum-messages      - the maximum number of messages to be delivered as
                        a result of a single poll of SQS.

num-consumers         - the number of concurrent long-polls to run

Returns a kill function - call the function to terminate the loop.

A background loop to receive SQS messages from a queue indefinitely.

 Arguments:
 sqs-config  - A map of the following keys, used for interacting with SQS:
    access-key - AWS access key ID
    secret-key - AWS secret access key
    endpoint   - SQS queue endpoint - usually an HTTPS based URL
    region     - AWS region
 queue-url - URL of the queue
 out-chan  - async channel where messages will be passed into
 opts      - an optional map containing the following keys:

    auto-delete           - boolean, if true, immediately delete the message,
                            if false, forward a `done` function and leave the
                            message intact. (default: true)

    restart-delay-seconds - how long (in seconds) to wait before attempting to
                            restart the consumer loop.

    maximum-messages      - the maximum number of messages to be delivered as
                            a result of a single poll of SQS.

    num-consumers         - the number of concurrent long-polls to run

Returns a kill function - call the function to terminate the loop.
sourceraw docstring

receive-one!clj

(receive-one! sqs-config queue-url)
source

send-fifo-messageclj

(send-fifo-message sqs-config
                   queue-url
                   payload
                   {message-group-id :message-group-id
                    deduplication-id :deduplication-id
                    format :format
                    :as options
                    :or {format :transit}})

Send a message to a FIFO queue.

Arguments: message-group-id - a tag that specifies the group that this message belongs to. Messages belonging to the same group are guaranteed FIFO

Options: deduplication-id - token used for deduplication of sent messages

Send a message to a FIFO queue.

Arguments:
message-group-id - a tag that specifies the group that this message
                   belongs to. Messages belonging to the same group
                   are guaranteed FIFO

Options:
deduplication-id -  token used for deduplication of sent messages
sourceraw docstring

send-messageclj

(send-message sqs-config queue-url payload)
(send-message sqs-config
              queue-url
              payload
              {:keys [format] :or {format :transit}})

Send a message to a standard queue, by default transit encoded. An optional map may be passed as a 5th argument, containing a :format key which should be set to either :json or :transit.

Send a message to a standard queue, by default transit encoded. An optional map
may be passed as a 5th argument, containing a `:format` key which should be
set to either `:json` or `:transit`.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close