h1. RSQS
h2. Description
A ruby implementation of the Amazon SQS API.
h2. Installation
sudo gem install rsqs
h2. Pre-Requirements
First, RSQS expects that you have the following environmental variables set:
AMAZON_ACCESS_KEY - Your amazon web services access key which you can
find under "Access Identifiers" in your AWS account.
AMAZON_SECRET_ACCESS_KEY - Your AWS secret access key which is found in
in the same place as the access key.
The easiest way to do this is to setup a file in your home directory and add
the following lines:
export AMAZON_ACCESS_KEY=1848101948W18189491
export AMAZON_SECRET_ACCESS_KEY=10198DKLDSL101/W31019D/10X
And then, assuming this file was called ".amazon_keys" you can load them:
source ~/.amazon_keys
h2. Usage
h3. Creating a New Queue
q = RSQS::Queue.create :new_queue
h3. Putting New Messages
Note: This will assume that :new_queue exists to save you requests to
SQS service. A QueueDoesNotExistError will be raised if the
queue doesn't exist.
RSQS::Queue.find :new_queue { send_message 'My New Message' }
OR
q = RSQS::Queue.find :new_queue
q.send_message 'My New Message'
NOTE: If you want RSQS to automatically create queues which do not exist,
use the find_or_create method instead!
h3. Getting Messages
q = RSQS::Queue.find :new_queue
m = q.receive
m # RSQS::Message
h2. License
(The MIT License)
Copyright (c) 2008 FIX
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.