Package io.vertx.amqp
Interface AmqpMessage
-
public interface AmqpMessageRepresents 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description AmqpMessageaccepted()When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message.Stringaddress()JsonObjectapplicationProperties()BufferbodyAsBinary()booleanbodyAsBoolean()bytebodyAsByte()charbodyAsChar()doublebodyAsDouble()floatbodyAsFloat()intbodyAsInteger()JsonArraybodyAsJsonArray()JsonObjectbodyAsJsonObject()<T> List<T>bodyAsList()longbodyAsLong()<K,V>
Map<K,V>bodyAsMap()shortbodyAsShort()StringbodyAsString()StringbodyAsSymbol()InstantbodyAsTimestamp()UUIDbodyAsUUID()StringcontentEncoding()StringcontentType()StringcorrelationId()static AmqpMessageBuildercreate()static AmqpMessageBuildercreate(AmqpMessage existing)Creates a builder to create a newAmqpMessagecopying the metadata from the passed message.static AmqpMessageBuildercreate(org.apache.qpid.proton.message.Message existing)Creates a builder to create a newAmqpMessagecopying the metadata from the passed (Proton) message.longcreationTime()intdeliveryCount()longexpiryTime()StringgroupId()longgroupSequence()Stringid()booleanisBodyNull()booleanisDurable()booleanisFirstAcquirer()AmqpMessagemodified(boolean deliveryFailed, boolean undeliverableHere)When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asmodified.intpriority()AmqpMessagerejected()When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asrejected.AmqpMessagereleased()When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asreleased.StringreplyTo()StringreplyToGroupId()Stringsubject()longttl()org.apache.qpid.proton.message.Messageunwrap()
-
-
-
Method Detail
-
create
static AmqpMessageBuilder create()
- Returns:
- a builder to create an
AmqpMessage.
-
create
static AmqpMessageBuilder create(AmqpMessage existing)
Creates a builder to create a newAmqpMessagecopying the metadata from the passed message.- Parameters:
existing- an existing message, must not benull.- Returns:
- a builder to create an
AmqpMessage.
-
create
static AmqpMessageBuilder create(org.apache.qpid.proton.message.Message existing)
Creates a builder to create a newAmqpMessagecopying the metadata from the passed (Proton) message.- Parameters:
existing- an existing (Proton) message, must not benull.- Returns:
- a builder to create an
AmqpMessage.
-
isDurable
boolean isDurable()
- Returns:
- whether or not the message is durable.
- See Also:
- AMQP specification
-
isFirstAcquirer
boolean isFirstAcquirer()
- Returns:
- if
true, then this message has not been acquired by any other link. Iffalse, then this message MAY have previously been acquired by another link or links. - See Also:
- AMQP specification
-
priority
int priority()
- Returns:
- the relative message priority. Higher numbers indicate higher priority messages. Messages with higher priorities MAY be delivered before those with lower priorities.
- See Also:
- AMQP specification
-
deliveryCount
int deliveryCount()
- 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.
- See Also:
- AMQP specification
-
ttl
long ttl()
- Returns:
- the duration in milliseconds for which the message is to be considered "live".
- See Also:
- AMQP specification
-
id
String id()
- Returns:
- the message id
- See Also:
- AMQP specification
-
address
String address()
- Returns:
- the message address, also named
tofield - See Also:
- AMQP specification
-
replyTo
String replyTo()
- Returns:
- The address of the node to send replies to, if any.
- See Also:
- AMQP specification
-
correlationId
String correlationId()
- Returns:
- The client-specific id that can be used to mark or identify messages between clients.
- See Also:
- AMQP specification
-
isBodyNull
boolean isBodyNull()
- Returns:
- whether the body is
null. This method returnstrueis the message does not contain a body or if the message contain anullAMQP value as body.
-
bodyAsBoolean
boolean bodyAsBoolean()
- Returns:
- the boolean value contained in the body. The value must be passed as AMQP value.
-
bodyAsByte
byte bodyAsByte()
- Returns:
- the byte value contained in the body. The value must be passed as AMQP value.
-
bodyAsShort
short bodyAsShort()
- Returns:
- the short value contained in the body. The value must be passed as AMQP value.
-
bodyAsInteger
int bodyAsInteger()
- Returns:
- the integer value contained in the body. The value must be passed as AMQP value.
-
bodyAsLong
long bodyAsLong()
- Returns:
- the long value contained in the body. The value must be passed as AMQP value.
-
bodyAsFloat
float bodyAsFloat()
- Returns:
- the float value contained in the body. The value must be passed as AMQP value.
-
bodyAsDouble
double bodyAsDouble()
- Returns:
- the double value contained in the body. The value must be passed as AMQP value.
-
bodyAsChar
char bodyAsChar()
- Returns:
- the character value contained in the body. The value must be passed as AMQP value.
-
bodyAsTimestamp
Instant bodyAsTimestamp()
- Returns:
- the timestamp value contained in the body. The value must be passed as AMQP value.
-
bodyAsUUID
UUID bodyAsUUID()
- Returns:
- the UUID value contained in the body. The value must be passed as AMQP value.
-
bodyAsBinary
Buffer bodyAsBinary()
- Returns:
- the bytes contained in the body. The value must be passed as AMQP data.
-
bodyAsString
String bodyAsString()
- Returns:
- the string value contained in the body. The value must be passed as AMQP value.
-
bodyAsSymbol
String bodyAsSymbol()
- Returns:
- the symbol value contained in the body. The value must be passed as AMQP value.
-
bodyAsList
<T> List<T> bodyAsList()
- Returns:
- the list of values contained in the body. The value must be passed as AMQP value.
-
bodyAsMap
<K,V> Map<K,V> bodyAsMap()
- Returns:
- the map contained in the body. The value must be passed as AMQP value.
-
bodyAsJsonObject
JsonObject bodyAsJsonObject()
- Returns:
- the JSON object contained in the body. The value must be passed as AMQP data.
-
bodyAsJsonArray
JsonArray bodyAsJsonArray()
- Returns:
- the JSON array contained in the body. The value must be passed as AMQP data.
-
subject
String subject()
-
contentType
String contentType()
-
contentEncoding
String contentEncoding()
-
expiryTime
long expiryTime()
-
creationTime
long creationTime()
-
groupId
String groupId()
-
replyToGroupId
String replyToGroupId()
-
groupSequence
long groupSequence()
-
applicationProperties
JsonObject applicationProperties()
- Returns:
- the message properties as JSON object.
-
unwrap
org.apache.qpid.proton.message.Message unwrap()
-
accepted
AmqpMessage 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 theacceptedstatus.- Returns:
- the current
AmqpMessageobject - Throws:
IllegalStateException- is the current message is not a received message.
-
rejected
AmqpMessage rejected()
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asrejected.- Returns:
- the current
AmqpMessageobject - Throws:
IllegalStateException- is the current message is not a received message.
-
released
AmqpMessage released()
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asreleased.- Returns:
- the current
AmqpMessageobject - Throws:
IllegalStateException- is the current message is not a received message.
-
modified
AmqpMessage modified(boolean deliveryFailed, boolean undeliverableHere)
When receiving a message, and when auto-acknowledgement is disabled, this method is used to acknowledge the incoming message asmodified.- Parameters:
deliveryFailed- passtrueto increase the failed delivery countundeliverableHere- passtrueto prevent re-delivery of this message to the same consumer- Returns:
- the current
AmqpMessageobject - Throws:
IllegalStateException- is the current message is not a received message.
-
-