Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better_sqs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better_sqs

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Better SQS

Making it easier for you to quickly interact with SQS in an idiomatic fashion.

Status

Circle CI

Usage

require "better_sqs"

better = BetterSqs::Client.new 
better.push "better_sqs_dev_queue", "You pushed the message successfully!"
# At this point you can confirm that the message was enqueued in the AWS console
message = better.reserve "better_sqs_dev_queue"
 
puts message.message_body

message.delete

If you prefer you can interact with a Queue directly for enqueue and dequeue operations

require "better_sqs"

better = BetterSqs::Client.new
queue = better.queue "better_sqs_dev_queue"
queue.push "You pushed the message successfully!"
message = queue.reserve

puts message.message_body
message.delete

Inspecting a queue

BetterSqs makes it easy to check on the attributes of a SQS queue.

require "better_sqs"

better = BetterSqs::Client.new
queue = better.queue("better_sqs_dev_queue")
queue.approximate_number_of_messages
queue.approximate_number_of_messages_not_visible
queue.visibility_timeout
queue.created_timestamp
queue.last_modified_timestamp
queue.policy
queue.maximum_message_size
queue.message_retention_period
queue.queue_arn
queue.approximate_number_of_messages_delayed
queue.delay_seconds
queue.receive_message_wait_time_seconds
queue.redrive_policy

Configuration

To configure BetterSqs use the configuration block pattern

require "better_sqs"
BetterSqs.configure do |config|
    # When a message is deferred, this number of seconds is added to the time period that the message
    # will remain invisible to other consumers. SQS has a hard cap of 12 hours on visibility.
    # It defaults to 60 seconds
    config.sqs_message_deferral_seconds = 120
    
    # If you want to hardcode which region of SQS should be used then you can set this option. It is recommended
    # to use the environment variable ENV["AWS_REGION"] instead
    config.region = "us-west-2"
    
    # for aws_access_key_id and aws_secret_access_key you can set them in this fashion, but it is strongly
    # recommended that you just use the environment variables instead: ENV["AWS_ACCESS_KEY_ID"], 
    # ENV["AWS_SECRET_ACCESS_KEY"]
end

FAQs

Package last updated on 08 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc