lib/message_queue/adapters/bunny/publisher.rb in message_queue-0.0.3 vs lib/message_queue/adapters/bunny/publisher.rb in message_queue-0.0.4
- old
+ new
@@ -29,10 +29,10 @@
@exchange_name = exchange_options.delete(:name) || (raise "Missing exchange name")
@exchange_type = exchange_options.delete(:type) || (raise "Missing exchange type")
@message_options = options.fetch(:message)
- @exchange = connection.connection.default_channel.send(exchange_type, exchange_name, exchange_options)
+ @exchange = connection.connection.create_channel.send(exchange_type, exchange_name, exchange_options)
end
def publish(payload, options = {})
exchange.publish(connection.serializer.dump(payload), message_options.merge(options))
end