Package org.springframework.integration
Class IntegrationMessageHeaderAccessor
java.lang.Object
org.springframework.messaging.support.MessageHeaderAccessor
org.springframework.integration.IntegrationMessageHeaderAccessor
public class IntegrationMessageHeaderAccessor extends MessageHeaderAccessor
Adds standard SI Headers.
- Since:
- 4.0
- Author:
- Andy Wilkinson, Artem Bilan, Gary Russell
-
Field Summary
Fields Modifier and Type Field Description static String
ACKNOWLEDGMENT_CALLBACK
A callback to acknowledge message delivery.static String
CLOSEABLE_RESOURCE
static String
CORRELATION_ID
static String
DELIVERY_ATTEMPT
static String
DUPLICATE_MESSAGE
static String
EXPIRATION_DATE
static String
PRIORITY
static String
ROUTING_SLIP
static String
SEQUENCE_DETAILS
static String
SEQUENCE_NUMBER
static String
SEQUENCE_SIZE
static String
SOURCE_DATA
Raw source message.Fields inherited from class org.springframework.messaging.support.MessageHeaderAccessor
DEFAULT_CHARSET
-
Constructor Summary
Constructors Constructor Description IntegrationMessageHeaderAccessor(Message<?> message)
-
Method Summary
Modifier and Type Method Description AcknowledgmentCallback
getAcknowledgmentCallback()
Return the acknowledgment callback, if present.Closeable
getCloseableResource()
If the payload was created by aCloseable
that needs to remain open until the payload is consumed, the resource will be added to this header.Object
getCorrelationId()
AtomicInteger
getDeliveryAttempt()
When a message-driven endpoint supports retry implicitly, this header is incremented for each delivery attempt.Long
getExpirationDate()
<T> T
getHeader(String key, Class<T> type)
Integer
getPriority()
int
getSequenceNumber()
int
getSequenceSize()
<T> T
getSourceData()
Get the source data header, if present.boolean
isReadOnly(String headerName)
void
setReadOnlyHeaders(String... readOnlyHeaders)
Specify a list of headers which should be considered as read only and prohibited from being populated in the message.Map<String,Object>
toMap()
protected void
verifyType(String headerName, Object headerValue)
Methods inherited from class org.springframework.messaging.support.MessageHeaderAccessor
copyHeaders, copyHeadersIfAbsent, createAccessor, getAccessor, getAccessor, getAccessor, getContentType, getDetailedLogMessage, getDetailedPayloadLogMessage, getErrorChannel, getHeader, getId, getMessageHeaders, getMutableAccessor, getReplyChannel, getShortLogMessage, getShortPayloadLogMessage, getTimestamp, isModified, isMutable, isReadableContentType, removeHeader, removeHeaders, setContentType, setErrorChannel, setErrorChannelName, setHeader, setHeaderIfAbsent, setImmutable, setLeaveMutable, setModified, setReplyChannel, setReplyChannelName, toMessageHeaders, toString
-
Field Details
-
CORRELATION_ID
- See Also:
- Constant Field Values
-
EXPIRATION_DATE
- See Also:
- Constant Field Values
-
PRIORITY
- See Also:
- Constant Field Values
-
SEQUENCE_NUMBER
- See Also:
- Constant Field Values
-
SEQUENCE_SIZE
- See Also:
- Constant Field Values
-
SEQUENCE_DETAILS
- See Also:
- Constant Field Values
-
ROUTING_SLIP
- See Also:
- Constant Field Values
-
DUPLICATE_MESSAGE
- See Also:
- Constant Field Values
-
CLOSEABLE_RESOURCE
- See Also:
- Constant Field Values
-
DELIVERY_ATTEMPT
- See Also:
- Constant Field Values
-
ACKNOWLEDGMENT_CALLBACK
A callback to acknowledge message delivery. The type of the header value depends on the context in which the header is used. See the reference manual for more information.- See Also:
- Constant Field Values
-
SOURCE_DATA
Raw source message.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
setReadOnlyHeaders
Specify a list of headers which should be considered as read only and prohibited from being populated in the message.- Parameters:
readOnlyHeaders
- the list of headers forreadOnly
mode. Defaults toMessageHeaders.ID
andMessageHeaders.TIMESTAMP
.- Since:
- 4.3.2
- See Also:
isReadOnly(String)
-
getExpirationDate
-
getCorrelationId
-
getSequenceNumber
public int getSequenceNumber() -
getSequenceSize
public int getSequenceSize() -
getPriority
-
getCloseableResource
If the payload was created by aCloseable
that needs to remain open until the payload is consumed, the resource will be added to this header. After the payload is consumed theCloseable
should be closed. Usually this must occur in an endpoint close to the message origin in the flow, and in the same JVM.- Returns:
- the
Closeable
. - Since:
- 4.3
-
getAcknowledgmentCallback
Return the acknowledgment callback, if present.- Returns:
- the callback.
- Since:
- 5.0.1
-
getDeliveryAttempt
When a message-driven endpoint supports retry implicitly, this header is incremented for each delivery attempt.- Returns:
- the delivery attempt.
- Since:
- 5.0.1
-
getSourceData
Get the source data header, if present.- Type Parameters:
T
- the data type.- Returns:
- the source header.
- Since:
- 5.1.6
-
getHeader
-
verifyType
- Overrides:
verifyType
in classMessageHeaderAccessor
-
isReadOnly
- Overrides:
isReadOnly
in classMessageHeaderAccessor
-
toMap
- Overrides:
toMap
in classMessageHeaderAccessor
-