Sha256: 4971c0e5da59d7b5db6892bdb93f42da66189d2baddd1afdf5078d14ddc65766

Contents?: true

Size: 731 Bytes

Versions: 7

Compression:

Stored size: 731 Bytes

Contents

$: << File.expand_path("../../lib", __FILE__)

require 'aws/sqs'

##
# Expects your Amazon keys to be in the environment, something like
#
# export AWS_KEY="KEY"
# export AWS_SECRET="SECRET"
##

sqs = AWS::SQS.new ENV["AWS_KEY"], ENV["AWS_SECRET"]

queue_name = "SimpleAWSTest"

puts "Creating queue #{queue_name}"
response = sqs.create_queue "QueueName" => queue_name
queue_url = response.queue_url

puts "Sending message to #{queue_url}"
sent = sqs.send_message queue_url, "MessageBody" => "This is a new message in the queue"

puts ""
p sent
puts ""

puts "Receiving message from #{queue_url}"
received = sqs.receive_message queue_url

puts ""
p received
puts ""

puts "Deleting queue #{queue_url}"
p sqs.delete_queue queue_url

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_aws-1.0.0 samples/sqs.rb
simple_aws-1.0.0.pre3 samples/sqs.rb
simple_aws-1.0.0.pre2 samples/sqs.rb
simple_aws-1.0.0.pre1 samples/sqs.rb
simple_aws-0.0.1d samples/sqs.rb
simple_aws-0.0.1c samples/sqs.rb
simple_aws-0.0.1b samples/sqs.rb