Questions tagged [bunny]

Bunny is an easy to use RabbitMQ Ruby client.

Bunny is an easy to use RabbitMQ Ruby client.

RabbitMQ messaging enables cross-platform software applications to connect and scale. Applications can connect to each other, as components of a larger application, or to user devices and data. Messaging is asynchronous, decoupling applications by separating sending and receiving data.

Sources:

91 questions
3
votes
1 answer

rabbitmq deletes queue binding after server restart

I am using bunny to setup rabbitmq queue. namespace :rabbitmq do desc 'Setup routing' task :setup_test_commands_queue do require 'bunny' conn = Bunny.new(ENV['SYNC_AMQP'], read_timeout: 10, heartbeat: 10) conn.start ch =…
dnsh
  • 3,516
  • 2
  • 22
  • 47
3
votes
1 answer

Rails - Test RabbitMQ notifications with Rspec. I am using the bunny gem

I am working on a very small app, it is a RabbitMQ notification system. It triggers an API call when a state changes. That part is fine and I believe is working correctly. What I am having problems is testing the notification part, I am using rspec…
Javier Perez
  • 1,855
  • 1
  • 11
  • 8
2
votes
1 answer

RabbitMQ Bunny Parallel Consumers

I have built an application which consists of one publisher, several queues and several consumers for each queue. Consumers on a queue (including the queue) share the channel. Other queues use a different channel. I am observing that for different…
Yeezus
  • 95
  • 9
2
votes
0 answers

rabbitMQ(bunny gem) + sidekiq not working in heroku for ruby application

Gem which i have used in this application gem 'redis', '~> 3.0' gem 'sidekiq' gem 'bunny' This is the consumer part to get the message from queue as a rake task. task :do_consumer => :environment do connection =…
Developer
  • 561
  • 7
  • 29
2
votes
2 answers

Graceful shutdown of an amqp (and/or) http daemon, (and about global variables)

I wrote an API daemon. It hardly processes requests in the loop (inside processing it can call other services by http and amqp, overload sql database etc). I want to find the best way to make a graceful shutdown for it. So when it receives sigterm…
Dimitri
  • 623
  • 7
  • 14
2
votes
1 answer

RabbitMQ/bunny: subscribe block not called if within a thread

I'm having trouble getting a queue subscribe block to execute if in a thread. The example from rubybunny/exchanges works, as expected. However, if adapted with the consumer portion in a thread, the subscriber block appears not to execute. I've tried…
Dacto
  • 2,901
  • 9
  • 45
  • 54
2
votes
1 answer

Bunny::NoFinalOctetError after some time without message

Using a rabbit mq installed with official docker image my worker fail with the exception Bunny::NoFinalOctetError after some time (around 40s) . My worker code is : require 'bunny' require 'securerandom' #TODO set host as parameter rabbit_conn =…
GPif
  • 543
  • 2
  • 6
  • 22
2
votes
1 answer

Is it possible to call Bunny::Exchange publish from Delayed Job?

I have a Rails app that sometimes publishes messages to a RabbitMQ queue, using the gem "Bunny". Here's the setup: # config/initializers/bunny.rb $mq_connection = Bunny.new $mq_connection.start $mq_channel = $mq_connection.create_channel Anywhere…
jibai31
  • 1,663
  • 18
  • 22
2
votes
1 answer

How can we setup delayed queueing with Bunny gem and RabbitMQ?

I have setup RabbitMQ and able to publish and consume messages with bunny gem from rails application instantly. How can we achieve delayed queueing with a pre-defined delay time per message while publishing to RabbitMQ exchange?
Ashik Salman
  • 1,819
  • 11
  • 15
2
votes
1 answer

Rspec 3 stub class variable

anybody know, how I can stub class variable initialization? I define @@connection = Bunny.new.start for restrict connection numbers, but now I have to test it, and when I try stub it in general way, like allow_any_instance_of(Bunny).to…
Oleh Sobchuk
  • 3,612
  • 2
  • 25
  • 41
2
votes
2 answers

How to access channels/queues opened on a Bunny session?

I'm using Rabbit MQ's Ruby client (Bunny). I moved the hole Bunny config and initializing process in an initializer. How can I access channels/queues opened on a Bunny connection from inside a controller or a lib? I get 'true' when I call…
Bogdan Popa
  • 1,099
  • 1
  • 16
  • 37
2
votes
3 answers

Using the bunny gem, how do I block until either a message is received or a timeout expires

I'm using the bunny ruby gem to send and receive messages to a rabbitmq server. How do I synchronously pop a message off the queue while putting a timeout on how long I wait (i.e. if no message arrives after 3 seconds, stop blocking)? One obvious…
Josh Rickard
  • 1,593
  • 2
  • 16
  • 29
2
votes
0 answers

Connection-level error: UNEXPECTED_FRAME hutch

I have producers that produce message in fanout manner via hutch where consumers to consume those message. Here I have a single RabbitMq server where multiple instances for hutch runs. Everything works fine in local/testing environment, but the…
cmthakur
  • 2,266
  • 4
  • 18
  • 23
2
votes
0 answers

Catching RabbitMQ connection loss mid Request on Passenger

I am using the bunny gem to publish messages to a RabbitMQ. Following the recommendation given in the official documentation for use with Passenger in Rack apps, I added connection creation to be executed after a new worker process was started. if…
2
votes
2 answers

How to pass parameters from a yaml file to a constructor, without expicitly mentioning each one?

I have this initialiser script for setting my RabbitMq connection using Bunny: require 'yaml' config = YAML.load_file('config/rabbitmq.yml') puts config[Rails.env] # $bunny = Bunny.new(config[Rails.env]) $bunny = Bunny.new(:host =>…
user000001
  • 32,226
  • 12
  • 81
  • 108