Class OutboundMessage
The transport does not know what the bytes mean, and does not add AceMQ headers: the
core has already flattened the envelope into headers() before handing it over.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this must be confirmed and checked for a return even on a connection made without publisher confirms.byte[]body()static OutboundMessage.Builderbody(byte[] body) @Nullable Stringexchange()How long the message stays worth delivering.headers()boolean@Nullable Stringbooleanpriority()replyTo()toString()
-
Method Details
-
body
- Parameters:
body- encoded payload- Returns:
- a builder defaulting to a persistent, mandatory publish
-
exchange
- Returns:
- target exchange, or the empty string to publish directly to a queue
-
routingKey
-
body
public byte[] body()- Returns:
- the encoded payload; the array is shared, so callers must not modify it
-
headers
-
messageId
-
contentType
-
persistent
public boolean persistent()- Returns:
- whether the broker should persist the message across a restart
-
mandatory
public boolean mandatory()- Returns:
- whether an unroutable message must be returned rather than dropped
- See Also:
-
expiration
How long the message stays worth delivering.Per-message, and enforced by the broker rather than by anything here. A transport that cannot express it must say so rather than dropping it: a message expected to expire in five minutes and instead kept forever is a slow leak, and one delivered long after it stopped meaning anything is worse than one never delivered.
- Returns:
- the time-to-live, when one was set
-
priority
- Returns:
- the priority this message was published with, if any
-
replyTo
- Returns:
- the queue a reply should be sent to, if this message expects one
-
alwaysConfirmed
public boolean alwaysConfirmed()Whether this must be confirmed and checked for a return even on a connection made without publisher confirms.Set on everything the library publishes on a caller's behalf: a retry hop, a move to
{queue}.dlqor{queue}.parked, a replay, a pipeline or routing-slip hop, a scheduled hop or delivery, an outbox record, a reply. Each acknowledges a message or marks a record done once the send returns, and an unconfirmed publish can only ever be reported as routed. A caller's own publishes keep the mode the connection was made with.- Returns:
- whether the transport must confirm this publish whatever the connection's mode
-
toString
-