0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the CassieQ API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

CassieQ Client

Gem Version Build Status

A Ruby wrapper for the CassieQ API

Installation

Install from RubyGems:

gem install cassieq-client

Require statement:

require "cassieq/client"

Usage

Create a client

With signed request authentication:

client = Cassieq::Client.new do |config| 
  config.host = "192.168.99.100"
  config.account = "account_name"
  config.key = "7dCFl6xxco1NIQSxSpseW5olftHHxHlc6Q12DY5VkBkCCs8_q3JrvYgPZapUSJ6PcaQDElunMsEFwDuOi6tQFQ"
end

With signed query string authentication, i.e. "claims":

client = Cassieq::Client.new do |config|
  config.host = "192.168.99.100"
  config.account = "account_name"
  config.provided_params = "auth=g&sig=9aw5gn22G-WN-RRBSQPR1zHgZHbiuv8SsFeODevDiqs"
end

Read more about CassieQ's authentication here.

Create a queue

client.create_queue(queue_name: "my_queue", bucket_size: 15, max_delivery_count: 10)
# => true

See CassieQ's API documentation for all queue creation options.

Add message to queue

client.publish_message("my_queue", "message content")
# => true

Get message from a queue

client.next_message("my_queue")
# => {:pop_receipt=>"MToyOkEyMnBLZw", :message=>"message content", :delivery_count=>0, :message_tag=>"A22pKg"}

Ack message

pop_receipt = "MToyOkEyMnBLZw"
client.ack_message("my_queue", pop_receipt)
# => true