Skip to content

Ruby samples to send/consume messages using AMQP protocol. Based in qpid_proton gem.

License

Notifications You must be signed in to change notification settings

rmarting/amqp-ruby-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMQP Ruby Client

This repo includes a set of simple samples using Qpid-Proton with Ruby Clients.

Prerequisites

Software needed:

  • Ruby 2.2
  • Qpid Proton packages for Ruby
  • AMQP Ruby Gem
  • AMQP endpoint to send/consume messages

A simple installation to run in a Fedora 28 workstation is:

$ sudo dnf install rubygem-qpid_proton rubygem-qpid_proton-doc
$ gem install qpid_proton amqp

ActiveMQ Artemis is a open source, high performance and scalable broker that implements AMQP protocol. You could install locally and test it using the Ruby Clients implemented here.

To install and start your local broker, please, refer the community documentation here

Senders

These classes send a number of messages using AMQP. There is a simple class to send a text message and other class to send the content of a file.

Pattern of use

$ ruby send-file.rb <connection-url> <address> <message-number> <path-to-file>

Sample of use (text message):

$ ruby send.rb amqp://user:password@localhost:5672 SampleQueue 10 'This a simple message'

Sample of use (file):

$ ruby send-file.rb amqp://user:password@localhost:5672 SampleQueue 10 ./message-body-content.txt

Receivers

This class consumes a number of messages using AMQP.

Sample of use (one message):

$ ruby receive.rb amqp://user:password@localhost:5672 SampleQueue

Sample of use (10 messages):

$ ruby receive.rb amqp://user:password@localhost:5672 SampleQueue 10

Main References

About

Ruby samples to send/consume messages using AMQP protocol. Based in qpid_proton gem.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages