1

I am creating an rabbitmq rpc in ruby 2.3 using bunny 2.7.0 I've made it with one reply queue per client. But I am expected to have quite a large amount of clients and it is not efficient to do it in this way. I want to use a direct reply feature of rabbitmq

connection = Bunny.new(rabbitmq_url, :automatically_recover => true)
connection.start

channel = connection.create_channel

reply_queue = channel.queue('amq.rabbitmq.reply-to', no_ack: true)

on the last line of code I receive error

Bunny::AccessRefused: ACCESS_REFUSED - queue name 'amq.rabbitmq.reply-to' contains reserved prefix 'amq.*'

in theory that is expected due to http://rubybunny.info/articles/queues.html

but on other hand - there is an article https://www.rabbitmq.com/direct-reply-to.html that describes existance an usability of this queue.

i want to declare a queue because i need to subscribe to it to receive respond

consumer = reply_queue.subscribe do |_, properties, payload|
    # action
end

I dont understand what am I doing wrong with it (

there are similar topics with examples of such approach but created on other languages and tools like nodejs and that seems to work fine. What am I doing wrong with bunny ?

Update

found the problem - I used odler version of rabbitmq server. That one that id not support direct reply queue yet

Anton bog
  • 11
  • 2

1 Answers1

0

I think it's trying to create it which you're not allowed to do.

https://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2013-September/030095.html

My ruby is a tad rusty but give this a try:

channel = connection.create_channel
channel.queue_declare('amq.rabbitmq.reply-to', :passive => true)
lpiner
  • 467
  • 4
  • 13