https://github.com/rmarting/amqp-ruby-client
Ruby samples to send/consume messages using AMQP protocol. Based in qpid_proton gem.
https://github.com/rmarting/amqp-ruby-client
amqp-client qpid-proton ruby samples
Last synced: over 1 year ago
JSON representation
Ruby samples to send/consume messages using AMQP protocol. Based in qpid_proton gem.
- Host: GitHub
- URL: https://github.com/rmarting/amqp-ruby-client
- Owner: rmarting
- License: gpl-3.0
- Created: 2018-09-14T04:57:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T05:14:28.000Z (almost 8 years ago)
- Last Synced: 2025-01-26T11:08:13.391Z (over 1 year ago)
- Topics: amqp-client, qpid-proton, ruby, samples
- Language: Ruby
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://activemq.apache.org/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](https://activemq.apache.org/artemis/docs/latest/using-server.html)
# 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
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
* [Qpid Proton](https://qpid.apache.org/proton/)
* [Qpid Proton AMQP Library - Ruby](https://qpid.apache.org/releases/qpid-proton-0.24.0/proton/ruby/api/index.html)
* [Proton Ruby Examples](https://qpid.apache.org/releases/qpid-proton-0.24.0/proton/ruby/examples/index.html)
* [qpid_proton Ruby Gem](https://rubygems.org/gems/qpid_proton/)