lib/amqp/client/message.rb in amqp-client-0.1.0 vs lib/amqp/client/message.rb in amqp-client-0.2.0
- old
+ new
@@ -1,5 +1,15 @@
# frozen_string_literal: true
module AMQP
- Message = Struct.new(:exchange_name, :routing_key, :properties, :body, :redelivered)
+ Message = Struct.new(:channel, :delivery_tag, :exchange_name, :routing_key, :properties, :body, :redelivered, :consumer_tag) do
+ def ack
+ channel.basic_ack(delivery_tag)
+ end
+
+ def reject(requeue: false)
+ channel.basic_reject(delivery_tag, requeue)
+ end
+ end
+
+ ReturnMessage = Struct.new(:reply_code, :reply_text, :exchange, :routing_key, :properties, :body)
end