You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the other Bunny::Channel methods that return an exchange look for the object first and return the existing one if it does not exist. But default_exchange returns a new object each time, and anything tied to the previous object is lost.
Example to reproduce the issue:
require' bunny'session=Bunny::Session.newsession.startchannel=session.channelchannel.default_exchange.on_return{ |*args| puts"dx1: on_message_return: #{args.inspect}"}channel.default_exchange.publish('message1',mandatory: true,routing_key: 'no_such_queue')# or dx2
Expected: the on_return callback is called
Actual: the on_return callback is never called
Workaround
Instead of calling channel.default_exchange call channel.direct(AMQ::Protocol::EMPTY_STRING, no_declare: true)
The text was updated successfully, but these errors were encountered:
RabbitMQ version: 3.11.15, installed via homebrew
Ruby version: 3.2.2
Bunny version: 2.20.3
Overview
All the other
Bunny::Channel
methods that return an exchange look for the object first and return the existing one if it does not exist. Butdefault_exchange
returns a new object each time, and anything tied to the previous object is lost.Example to reproduce the issue:
Expected: the
on_return
callback is calledActual: the
on_return
callback is never calledWorkaround
Instead of calling
channel.default_exchange
callchannel.direct(AMQ::Protocol::EMPTY_STRING, no_declare: true)
The text was updated successfully, but these errors were encountered: