class AMQP::Client::Message
A message delivered from the broker
Attributes
The message body @return [String]
The channel the message was deliviered to @return [Connection::Channel]
The tag of the consumer the message was deliviered to @return [String] @return [nil] If the message was polled and not deliviered to a consumer
The delivery tag of the message, used for acknowledge or reject the message @return [Integer]
Name of the exchange the message was published to @return [String]
Message
properties @return [Properties]
True if the message have been delivered before @return [Boolean]
The routing key the message was published with @return [String]
Public Class Methods
@api private
# File lib/amqp/client/message.rb, line 8 def initialize(channel, consumer_tag, delivery_tag, exchange, routing_key, redelivered) @channel = channel @consumer_tag = consumer_tag @delivery_tag = delivery_tag @exchange = exchange @routing_key = routing_key @redelivered = redelivered @properties = nil @body = "" end
Public Instance Methods
Acknowledge the message @return [nil]
# File lib/amqp/client/message.rb, line 54 def ack @channel.basic_ack(@delivery_tag) end
@see exchange
@deprecated @!attribute [r] exchange_name
@return [String]
# File lib/amqp/client/message.rb, line 69 def exchange_name @exchange end
Reject the message @param requeue [Boolean] If true the message will be put back into the queue again, ready to be redelivered @return [nil]
# File lib/amqp/client/message.rb, line 61 def reject(requeue: false) @channel.basic_reject(@delivery_tag, requeue: requeue) end