0.0
Low commit activity in last 3 years
No release in over a year
A base Telemetry gem for connecting to AMQP services for transport
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Telemetry::AMQP

A ruby gem used to connect to RabbitMQ.

Examples

require 'telemetry/amqp'

Telemetry::AMQP.connect!(username: 'guest', password: 'guest', node: '127.0.0.1')
Telemetry::AMQP.session # => Bunny::Session
Telemetry::AMQP.channel # => Bunny::Channel

You can also initiate multiple connections using the Base class

rmq = Telemetry::AMQP::Base.new(username: 'guest', vhost: 'custom_vhost')
rmq.session # => Bunny:Session
rmq.channel # => Bunny::Channel

Connection Options

These are the configurable options and their defaults

{
  username: 'guest',
  password: 'guest',
  nodes: ['127.0.0.1'],
  port: 5672,
  use_ssl: false,
  connection_name: '',
  automatically_recover: true,
  verify_peer: true,
  application: 'telemetry::amqp',
  app_version: Telemetry::AMQP::VERSION,
  connection_name: 'telemetry_amqp:0.1.0'
}

Channels

Currently channels within Telemetry::AMQP use the concurrent-ruby class of Concurrent::ThreadLocalVar so that we use a different channel for each Ruby thread automatically. This is per the bunny docs

Parts of the library (most notably Bunny::Channel) are designed to assume they are not shared between threads.