Class: AMQP::Client::ReturnMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp/client/message.rb

Overview

A published message returned by the broker due to some error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reply_code, reply_text, exchange, routing_key) ⇒ ReturnMessage

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ReturnMessage.



142
143
144
145
146
147
148
149
# File 'lib/amqp/client/message.rb', line 142

def initialize(reply_code, reply_text, exchange, routing_key)
  @reply_code = reply_code
  @reply_text = reply_text
  @exchange = exchange
  @routing_key = routing_key
  @properties = nil
  @body = ""
end

Instance Attribute Details

#bodyString

The message body

Returns:

  • (String)


173
174
175
# File 'lib/amqp/client/message.rb', line 173

def body
  @body
end

#exchangeString (readonly)

Name of the exchange the message was published to

Returns:

  • (String)


161
162
163
# File 'lib/amqp/client/message.rb', line 161

def exchange
  @exchange
end

#propertiesProperties

Message properties

Returns:



169
170
171
# File 'lib/amqp/client/message.rb', line 169

def properties
  @properties
end

#reply_codeInteger (readonly)

Error code

Returns:

  • (Integer)


153
154
155
# File 'lib/amqp/client/message.rb', line 153

def reply_code
  @reply_code
end

#reply_textString (readonly)

Description on why the message was returned

Returns:

  • (String)


157
158
159
# File 'lib/amqp/client/message.rb', line 157

def reply_text
  @reply_text
end

#routing_keyString (readonly)

The routing key the message was published with

Returns:

  • (String)


165
166
167
# File 'lib/amqp/client/message.rb', line 165

def routing_key
  @routing_key
end