Class: VertxAmqpClient::AmqpMessage
- Inherits:
-
Object
- Object
- VertxAmqpClient::AmqpMessage
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb
Overview
Represents an AMQP message.
Reference about the different metadata can be found on AMQP message properties.
Note that the body is retrieved using body* method depending on the expected type.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxAmqpClient::AmqpMessageBuilder) create(existing = nil)
Creates a builder to create a new AmqpMessage copying the metadata from the passed message.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (self) accepted
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message.
-
- (String) address
The message address, also named to field.
-
- (Hash{String => Object}) application_properties
The message properties as JSON object.
-
- (::Vertx::Buffer) body_as_binary
The bytes contained in the body.
-
- (true, false) body_as_boolean?
The boolean value contained in the body.
-
- (Fixnum) body_as_byte
The byte value contained in the body.
-
- (Fixnum) body_as_char
The character value contained in the body.
-
- (Float) body_as_double
The double value contained in the body.
-
- (Float) body_as_float
The float value contained in the body.
-
- (Fixnum) body_as_integer
The integer value contained in the body.
-
- (Array<String,Object>) body_as_json_array
The JSON array contained in the body.
-
- (Hash{String => Object}) body_as_json_object
The JSON object contained in the body.
-
- (Array<Object>) body_as_list
The list of values contained in the body.
-
- (Fixnum) body_as_long
The long value contained in the body.
-
- (Fixnum) body_as_short
The short value contained in the body.
-
- (String) body_as_string
The string value contained in the body.
-
- (String) body_as_symbol
The symbol value contained in the body.
-
- (true, false) body_null?
Whether the body is null.
- - (String) content_encoding
- - (String) content_type
-
- (String) correlation_id
The client-specific id that can be used to mark or identify messages between clients.
- - (Fixnum) creation_time
-
- (Fixnum) delivery_count
The number of unsuccessful previous attempts to deliver this message.
-
- (true, false) durable?
Whether or not the message is durable.
- - (Fixnum) expiry_time
-
- (true, false) first_acquirer?
If true, then this message has not been acquired by any other link.
- - (String) group_id
- - (Fixnum) group_sequence
-
- (String) id
The message id.
-
- (self) modified(didItFail = nil, wasItDeliveredHere = nil)
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message as modified.
-
- (Fixnum) priority
The relative message priority.
-
- (self) rejected
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message as rejected.
-
- (self) released
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message as released.
-
- (String) reply_to
The address of the node to send replies to, if any.
- - (String) reply_to_group_id
- - (String) subject
-
- (Fixnum) ttl
The duration in milliseconds for which the message is to be considered "live".
Class Method Details
+ (Boolean) accept?(obj)
24 25 26 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 24 def @@j_api_type.accept?(obj) obj.class == AmqpMessage end |
+ (::VertxAmqpClient::AmqpMessageBuilder) create(existing = nil)
Creates a builder to create a new VertxAmqpClient::AmqpMessage copying the metadata from the passed message.
42 43 44 45 46 47 48 49 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 42 def self.create(existing=nil) if !block_given? && existing == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxAmqp::AmqpMessage.java_method(:create, []).call(),::VertxAmqpClient::AmqpMessageBuilder) elsif existing.class.method_defined?(:j_del) && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxAmqp::AmqpMessage.java_method(:create, [Java::IoVertxAmqp::AmqpMessage.java_class]).call(existing.j_del),::VertxAmqpClient::AmqpMessageBuilder) end raise ArgumentError, "Invalid arguments when calling create(#{existing})" end |
+ (Object) j_api_type
33 34 35 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 33 def self.j_api_type @@j_api_type end |
+ (Object) j_class
36 37 38 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 36 def self.j_class Java::IoVertxAmqp::AmqpMessage.java_class end |
+ (Object) unwrap(obj)
30 31 32 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 30 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
27 28 29 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 27 def @@j_api_type.wrap(obj) AmqpMessage.new(obj) end |
Instance Method Details
- (self) accepted
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message. It marks the message as delivered with the
accepted status.
284 285 286 287 288 289 290 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 284 def accepted if !block_given? @j_del.java_method(:accepted, []).call() return self end raise ArgumentError, "Invalid arguments when calling accepted()" end |
- (String) address
Returns the message address, also named
to field
93 94 95 96 97 98 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 93 def address if !block_given? return @j_del.java_method(:address, []).call() end raise ArgumentError, "Invalid arguments when calling address()" end |
- (Hash{String => Object}) application_properties
Returns the message properties as JSON object.
275 276 277 278 279 280 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 275 def application_properties if !block_given? return @j_del.java_method(:applicationProperties, []).call() != nil ? JSON.parse(@j_del.java_method(:applicationProperties, []).call().encode) : nil end raise ArgumentError, "Invalid arguments when calling application_properties()" end |
- (::Vertx::Buffer) body_as_binary
Returns the bytes contained in the body. The value must be passed as AMQP data.
177 178 179 180 181 182 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 177 def body_as_binary if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:bodyAsBinary, []).call(),::Vertx::Buffer) end raise ArgumentError, "Invalid arguments when calling body_as_binary()" end |
- (true, false) body_as_boolean?
Returns the boolean value contained in the body. The value must be passed as AMQP value.
121 122 123 124 125 126 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 121 def body_as_boolean? if !block_given? return @j_del.java_method(:bodyAsBoolean, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_boolean?()" end |
- (Fixnum) body_as_byte
Returns the byte value contained in the body. The value must be passed as AMQP value.
128 129 130 131 132 133 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 128 def body_as_byte if !block_given? return @j_del.java_method(:bodyAsByte, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_byte()" end |
- (Fixnum) body_as_char
Returns the character value contained in the body. The value must be passed as AMQP value.
170 171 172 173 174 175 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 170 def body_as_char if !block_given? return @j_del.java_method(:bodyAsChar, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_char()" end |
- (Float) body_as_double
Returns the double value contained in the body. The value must be passed as AMQP value.
163 164 165 166 167 168 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 163 def body_as_double if !block_given? return @j_del.java_method(:bodyAsDouble, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_double()" end |
- (Float) body_as_float
Returns the float value contained in the body. The value must be passed as AMQP value.
156 157 158 159 160 161 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 156 def body_as_float if !block_given? return @j_del.java_method(:bodyAsFloat, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_float()" end |
- (Fixnum) body_as_integer
Returns the integer value contained in the body. The value must be passed as AMQP value.
142 143 144 145 146 147 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 142 def body_as_integer if !block_given? return @j_del.java_method(:bodyAsInteger, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_integer()" end |
- (Array<String,Object>) body_as_json_array
Returns the JSON array contained in the body. The value must be passed as AMQP data.
212 213 214 215 216 217 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 212 def body_as_json_array if !block_given? return @j_del.java_method(:bodyAsJsonArray, []).call() != nil ? JSON.parse(@j_del.java_method(:bodyAsJsonArray, []).call().encode) : nil end raise ArgumentError, "Invalid arguments when calling body_as_json_array()" end |
- (Hash{String => Object}) body_as_json_object
Returns the JSON object contained in the body. The value must be passed as AMQP data.
205 206 207 208 209 210 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 205 def body_as_json_object if !block_given? return @j_del.java_method(:bodyAsJsonObject, []).call() != nil ? JSON.parse(@j_del.java_method(:bodyAsJsonObject, []).call().encode) : nil end raise ArgumentError, "Invalid arguments when calling body_as_json_object()" end |
- (Array<Object>) body_as_list
Returns the list of values contained in the body. The value must be passed as AMQP value.
198 199 200 201 202 203 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 198 def body_as_list if !block_given? return @j_del.java_method(:bodyAsList, []).call().to_a.map { |elt| ::Vertx::Util::Utils.from_object(elt) } end raise ArgumentError, "Invalid arguments when calling body_as_list()" end |
- (Fixnum) body_as_long
Returns the long value contained in the body. The value must be passed as AMQP value.
149 150 151 152 153 154 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 149 def body_as_long if !block_given? return @j_del.java_method(:bodyAsLong, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_long()" end |
- (Fixnum) body_as_short
Returns the short value contained in the body. The value must be passed as AMQP value.
135 136 137 138 139 140 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 135 def body_as_short if !block_given? return @j_del.java_method(:bodyAsShort, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_short()" end |
- (String) body_as_string
Returns the string value contained in the body. The value must be passed as AMQP value.
184 185 186 187 188 189 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 184 def body_as_string if !block_given? return @j_del.java_method(:bodyAsString, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_string()" end |
- (String) body_as_symbol
Returns the symbol value contained in the body. The value must be passed as AMQP value.
191 192 193 194 195 196 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 191 def body_as_symbol if !block_given? return @j_del.java_method(:bodyAsSymbol, []).call() end raise ArgumentError, "Invalid arguments when calling body_as_symbol()" end |
- (true, false) body_null?
Returns whether the body is
null. This method returns true is the message does not contain a body or if the message contain a null AMQP value as body.
114 115 116 117 118 119 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 114 def body_null? if !block_given? return @j_del.java_method(:isBodyNull, []).call() end raise ArgumentError, "Invalid arguments when calling body_null?()" end |
- (String) content_encoding
233 234 235 236 237 238 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 233 def content_encoding if !block_given? return @j_del.java_method(:contentEncoding, []).call() end raise ArgumentError, "Invalid arguments when calling content_encoding()" end |
- (String) content_type
226 227 228 229 230 231 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 226 def content_type if !block_given? return @j_del.java_method(:contentType, []).call() end raise ArgumentError, "Invalid arguments when calling content_type()" end |
- (String) correlation_id
Returns The client-specific id that can be used to mark or identify messages between clients.
107 108 109 110 111 112 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 107 def correlation_id if !block_given? return @j_del.java_method(:correlationId, []).call() end raise ArgumentError, "Invalid arguments when calling correlation_id()" end |
- (Fixnum) creation_time
247 248 249 250 251 252 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 247 def creation_time if !block_given? return @j_del.java_method(:creationTime, []).call() end raise ArgumentError, "Invalid arguments when calling creation_time()" end |
- (Fixnum) delivery_count
Returns the number of unsuccessful previous attempts to deliver this message. If this value is non-zero it can be taken as an indication that the delivery might be a duplicate. On first delivery, the value is zero. It is incremented upon an outcome being settled at the sender, according to rules defined for each outcome.
72 73 74 75 76 77 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 72 def delivery_count if !block_given? return @j_del.java_method(:deliveryCount, []).call() end raise ArgumentError, "Invalid arguments when calling delivery_count()" end |
- (true, false) durable?
Returns whether or not the message is durable.
51 52 53 54 55 56 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 51 def durable? if !block_given? return @j_del.java_method(:isDurable, []).call() end raise ArgumentError, "Invalid arguments when calling durable?()" end |
- (Fixnum) expiry_time
240 241 242 243 244 245 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 240 def expiry_time if !block_given? return @j_del.java_method(:expiryTime, []).call() end raise ArgumentError, "Invalid arguments when calling expiry_time()" end |
- (true, false) first_acquirer?
Returns if
true, then this message has not been acquired by any other link. If false, then this message MAY have previously been acquired by another link or links.
58 59 60 61 62 63 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 58 def first_acquirer? if !block_given? return @j_del.java_method(:isFirstAcquirer, []).call() end raise ArgumentError, "Invalid arguments when calling first_acquirer?()" end |
- (String) group_id
254 255 256 257 258 259 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 254 def group_id if !block_given? return @j_del.java_method(:groupId, []).call() end raise ArgumentError, "Invalid arguments when calling group_id()" end |
- (Fixnum) group_sequence
268 269 270 271 272 273 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 268 def group_sequence if !block_given? return @j_del.java_method(:groupSequence, []).call() end raise ArgumentError, "Invalid arguments when calling group_sequence()" end |
- (String) id
Returns the message id
86 87 88 89 90 91 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 86 def id if !block_given? return @j_del.java_method(:id, []).call() end raise ArgumentError, "Invalid arguments when calling id()" end |
- (self) modified(didItFail = nil, wasItDeliveredHere = nil)
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
modified.
316 317 318 319 320 321 322 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 316 def modified(didItFail=nil,wasItDeliveredHere=nil) if (didItFail.class == TrueClass || didItFail.class == FalseClass) && (wasItDeliveredHere.class == TrueClass || wasItDeliveredHere.class == FalseClass) && !block_given? @j_del.java_method(:modified, [Java::boolean.java_class,Java::boolean.java_class]).call(didItFail,wasItDeliveredHere) return self end raise ArgumentError, "Invalid arguments when calling modified(#{didItFail},#{wasItDeliveredHere})" end |
- (Fixnum) priority
Returns the relative message priority. Higher numbers indicate higher priority messages. Messages with higher priorities MAY be delivered before those with lower priorities.
65 66 67 68 69 70 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 65 def priority if !block_given? return @j_del.java_method(:priority, []).call() end raise ArgumentError, "Invalid arguments when calling priority()" end |
- (self) rejected
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
rejected.
294 295 296 297 298 299 300 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 294 def rejected if !block_given? @j_del.java_method(:rejected, []).call() return self end raise ArgumentError, "Invalid arguments when calling rejected()" end |
- (self) released
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
released.
304 305 306 307 308 309 310 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 304 def released if !block_given? @j_del.java_method(:released, []).call() return self end raise ArgumentError, "Invalid arguments when calling released()" end |
- (String) reply_to
Returns The address of the node to send replies to, if any.
100 101 102 103 104 105 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 100 def reply_to if !block_given? return @j_del.java_method(:replyTo, []).call() end raise ArgumentError, "Invalid arguments when calling reply_to()" end |
- (String) reply_to_group_id
261 262 263 264 265 266 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 261 def reply_to_group_id if !block_given? return @j_del.java_method(:replyToGroupId, []).call() end raise ArgumentError, "Invalid arguments when calling reply_to_group_id()" end |
- (String) subject
219 220 221 222 223 224 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 219 def subject if !block_given? return @j_del.java_method(:subject, []).call() end raise ArgumentError, "Invalid arguments when calling subject()" end |
- (Fixnum) ttl
Returns the duration in milliseconds for which the message is to be considered "live".
79 80 81 82 83 84 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-amqp-client/amqp_message.rb', line 79 def ttl if !block_given? return @j_del.java_method(:ttl, []).call() end raise ArgumentError, "Invalid arguments when calling ttl()" end |