Class AceHeaders
These names are the interoperability surface of the whole project. A Go publisher and an Elixir consumer agree because they agree on these strings, and a service that does not use AceMQ at all can still read them. They are frozen at specification version 1: renaming one is a breaking change for every language port simultaneously.
Two groups of names here deliberately do not carry the x-acemq- prefix. Trace
context does not, because traceparent and tracestate are W3C names that other
tools already know how to read. The SHARED_PREFIX names do not, because they are
written by a pattern rather than by the engine and have to reach the handler: a header in the
reserved namespace is stripped on consume, which for these would mean writing them and finding
them gone.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDelivery attempt counter, starting at 1 and incremented by the retry engine.static final StringIdentifier of the message that caused this one to be published.static final StringWhere the payload is, when the application stores it outside the message.static final StringBusiness correlation identifier, propagated unchanged across hops.static final StringWhy a message was dead-lettered.static final StringEpoch milliseconds of the first publish, used for age-based give-up.static final StringUnique message identifier, and the default idempotency key.static final StringIdentifier of the publishing process, conventionallyservice@host.static final StringThe engine's namespace.static final StringHow many times the message has been replayed.static final StringWhen the message was last replayed.static final StringQueue a message was replayed from, set by the replay API for auditing.static final StringQueue a request's reply should be sent to.static final StringA responder's failure, carried back to the requester on the reply.static final StringA self-describing itinerary: the stops a message still has to make, as JSON.static final StringThe namespace AceMQ defines but does not reserve.static final StringW3C trace context.static final StringW3C trace state.static final StringLogical message type, for exampleorder.placed.static final StringSchema version of the payload, as an integer. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAceHeader(String headerName) Reports whether a header name belongs to AceMQ.
-
Field Details
-
PREFIX
The engine's namespace.Reserved. A header carrying this prefix is treated as the engine's, materialised as a field on the
Envelopeif it is one this version knows about, and dropped from the application's headers either way. Putting your own header here means writing it on publish and finding it gone on consume, with nothing reporting the loss.Use a namespace of your own —
x-yourcompany-— for anything the application or a pattern needs to survive the round trip.- See Also:
-
SHARED_PREFIX
The namespace AceMQ defines but does not reserve.A header here is one AceMQ writes and reads, but it is an ordinary application header on the wire:
isAceHeader(java.lang.String)does not match it,Envelope.Builder.headeraccepts it, and it survives to the handler like any other. That is the whole point. A responder has to read the reply address out of the message it was handed, and a handler has to be able to see that the message it is looking at came back off a dead-letter queue. Put either in the reserved namespace and the engine eats it on the way in.Go, Python and Ruby use exactly these strings for exactly these headers. Java used to put the replay three in the reserved namespace, and was alone in doing so.
- See Also:
-
ID
Unique message identifier, and the default idempotency key.- See Also:
-
TYPE
Logical message type, for exampleorder.placed.- See Also:
-
VERSION
Schema version of the payload, as an integer.- See Also:
-
CORRELATION
Business correlation identifier, propagated unchanged across hops.- See Also:
-
CAUSATION
Identifier of the message that caused this one to be published.- See Also:
-
ATTEMPT
Delivery attempt counter, starting at 1 and incremented by the retry engine.- See Also:
-
FIRST_SEEN
Epoch milliseconds of the first publish, used for age-based give-up.- See Also:
-
ORIGIN
Identifier of the publishing process, conventionallyservice@host.- See Also:
-
CLAIM
Where the payload is, when the application stores it outside the message.Materialised as
Envelope.claim(). Set by the application, never by the engine, and never interpreted by it — it is for an operator reading a dead-letter queue.Not written by the claim-check pattern, which frames its reference in the body and sets no header, because a header can be stripped by a shovel or a federation link. All five libraries make that choice deliberately.
- See Also:
-
ERROR
Why a message was dead-lettered. Present only on messages in a dead-letter queue.- See Also:
-
REPLY_TO
Queue a request's reply should be sent to.Written alongside AMQP's own
reply-toproperty rather than instead of it, and read in preference to it. The property is the older of the two and the one a non-AceMQ service understands; the header is what Go, Python and Ruby have always written, and the only one of the pair that survives a broker hop that rebuilds the message. Writing both and reading either is what lets a requester in one language be answered by a responder in another, in both directions and whichever of them is older.- See Also:
-
RESPONDER_ERROR
A responder's failure, carried back to the requester on the reply.Its value is the failure as text (
ExceptionType: messagefrom this library, Python and Ruby; the error's text from Go). A requester reads it before decoding the body and raises it as the responder's failure, so an answer that failed is never mistaken for an answer, nor for an undecodable one. Not to be confused withERROR, which says why a message was dead-lettered.- See Also:
-
ROUTING_SLIP
A self-describing itinerary: the stops a message still has to make, as JSON.The other half of
RoutingSlip.ROUTE, which names steps and leaves a declared pipeline to say where each one lives. This header carries the exchange and routing key of every stop with it, so a consumer that has never heard of the pipeline can still send the message on. Go, Python and Ruby write this one; a declared pipeline is the better model when there is a declaration, and this is what there is when there is not.- See Also:
-
REPLAYED_FROM
Queue a message was replayed from, set by the replay API for auditing.- See Also:
-
REPLAYED_AT
When the message was last replayed.- See Also:
-
REPLAY_COUNT
How many times the message has been replayed.Worth carrying separately from the attempt count, which a replay resets. A message on its fifth trip through a dead-letter queue is saying something that a fresh-looking attempt counter would hide.
- See Also:
-
TRACEPARENT
W3C trace context. Not prefixed, so non-AceMQ tooling recognises it.- See Also:
-
TRACESTATE
W3C trace state. Not prefixed, for the same reason asTRACEPARENT.- See Also:
-
-
Method Details
-
isAceHeader
Reports whether a header name belongs to AceMQ.Useful when copying headers between messages: AceMQ-owned headers are re-derived by the engine rather than propagated verbatim.
- Parameters:
headerName- header name to test, may benull- Returns:
trueif the name carries thePREFIX
-