new AmqpMessage()
Represents an AMQP message.
Reference about the different metadata can be found on AMQP message properties.
Methods
accepted() → {AmqpMessage}
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.
Returns:
the current AmqpMessage object
- Type
- AmqpMessage
address() → {string}
Returns:
the message address, also named
to field
- Type
- string
applicationProperties() → {Object}
Returns:
the message properties as JSON object.
- Type
- Object
bodyAsBinary() → {Buffer}
Returns:
the bytes contained in the body. The value must be passed as AMQP data.
- Type
- Buffer
bodyAsBoolean() → {boolean}
Returns:
the boolean value contained in the body. The value must be passed as AMQP value.
- Type
- boolean
bodyAsByte() → {number}
Returns:
the byte value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsChar() → {string}
Returns:
the character value contained in the body. The value must be passed as AMQP value.
- Type
- string
bodyAsDouble() → {number}
Returns:
the double value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsFloat() → {number}
Returns:
the float value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsInteger() → {number}
Returns:
the integer value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsJsonArray() → {Array}
Returns:
the JSON array contained in the body. The value must be passed as AMQP data.
- Type
- Array
bodyAsJsonObject() → {Object}
Returns:
the JSON object contained in the body. The value must be passed as AMQP data.
- Type
- Object
bodyAsList() → {Array.<Object>}
Returns:
the list of values contained in the body. The value must be passed as AMQP value.
- Type
- Array.<Object>
bodyAsLong() → {number}
Returns:
the long value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsShort() → {number}
Returns:
the short value contained in the body. The value must be passed as AMQP value.
- Type
- number
bodyAsString() → {string}
Returns:
the string value contained in the body. The value must be passed as AMQP value.
- Type
- string
bodyAsSymbol() → {string}
Returns:
the symbol value contained in the body. The value must be passed as AMQP value.
- Type
- string
contentEncoding() → {string}
Returns:
- Type
- string
contentType() → {string}
Returns:
- Type
- string
correlationId() → {string}
Returns:
The client-specific id that can be used to mark or identify messages between clients.
- Type
- string
creationTime() → {number}
Returns:
- Type
- number
deliveryCount() → {number}
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.
- Type
- number
expiryTime() → {number}
Returns:
- Type
- number
groupId() → {string}
Returns:
- Type
- string
groupSequence() → {number}
Returns:
- Type
- number
id() → {string}
Returns:
the message id
- Type
- string
isBodyNull() → {boolean}
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.
- Type
- boolean
isDurable() → {boolean}
Returns:
whether or not the message is durable.
- Type
- boolean
isFirstAcquirer() → {boolean}
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.
- Type
- boolean
modified(didItFail, wasItDeliveredHere) → {AmqpMessage}
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
modified.
Parameters:
| Name | Type | Description |
|---|---|---|
didItFail |
boolean | pass true to increase the failed delivery count |
wasItDeliveredHere |
boolean | pass true to prevent the re-delivery of the message |
Returns:
the current AmqpMessage object
- Type
- AmqpMessage
priority() → {number}
Returns:
the relative message priority. Higher numbers indicate higher priority messages. Messages with higher priorities MAY be delivered before those with lower priorities.
- Type
- number
rejected() → {AmqpMessage}
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
rejected.
Returns:
the current AmqpMessage object
- Type
- AmqpMessage
released() → {AmqpMessage}
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge
the incoming message as
released.
Returns:
the current AmqpMessage object
- Type
- AmqpMessage
replyTo() → {string}
Returns:
The address of the node to send replies to, if any.
- Type
- string
replyToGroupId() → {string}
Returns:
- Type
- string
subject() → {string}
Returns:
- Type
- string
ttl() → {number}
Returns:
the duration in milliseconds for which the message is to be considered "live".
- Type
- number