Project

sqs_bunny

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Polls a single SQS queue and copies the body of any messages to a configurable set of child queues then deletes the message from the parent.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1

Runtime

~> 2.0.beta
 Project Readme

sqs-bunny

Utility for spreading messages from one sqs queue to multiple children

This utility will poll a single Amazon AWS SQS queue and make copies of the message and add them to other queues.

For example, you could have an "outbox" queue that you polled and then had all messages delivered to "email" and "sms". It would be up to the email and sms queues to decided what to do with the message and process them if the message content was interesting.

Setup

gem install sqs-bunny

Setup a JSON configuration file like the example below which will monitor my-parent-q and copy the body of all messags to both test-child and test-child-2

{
    "parent_q": {
        "queue_url": "https://sqs.us-east-1.amazonaws.com/12345/my-parent-q"
    },
     "children": [
        {
            "queue_url": "https://sqs.us-east-1.amazonaws.com/12345/test-child"
        },
        {
            "queue_url": "https://sqs.us-east-1.amazonaws.com/12345/test-child-2"
        }
    ],
    "wait_time_seconds":10 #optional time that the thread will long poll the parent queue, default = 10
}

Running

The simplest way to run is by passing your credentials and configuration file on the command line:

AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=MYACCESSKEY AWS_SECRET_ACCESS_KEY=MYSECRETKEY sqs_bunny /path/to/setup.json 

AWS Credentials

This gem relies on the AWS SDK for Ruby Version 2.0.0. See the link for details on how to configure your AWS Credentials.