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 SummaryFields Modifier and Type Field Description static StringACKNOWLEDGMENT_CALLBACKA callback to acknowledge message delivery.static StringCLOSEABLE_RESOURCEstatic StringCORRELATION_IDstatic StringDELIVERY_ATTEMPTstatic StringDUPLICATE_MESSAGEstatic StringEXPIRATION_DATEstatic StringPRIORITYstatic StringROUTING_SLIPstatic StringSEQUENCE_DETAILSstatic StringSEQUENCE_NUMBERstatic StringSEQUENCE_SIZEstatic StringSOURCE_DATARaw source message.Fields inherited from class org.springframework.messaging.support.MessageHeaderAccessorDEFAULT_CHARSET
- 
Constructor SummaryConstructors Constructor Description IntegrationMessageHeaderAccessor(Message<?> message)
- 
Method SummaryModifier and Type Method Description AcknowledgmentCallbackgetAcknowledgmentCallback()Return the acknowledgment callback, if present.CloseablegetCloseableResource()If the payload was created by aCloseablethat needs to remain open until the payload is consumed, the resource will be added to this header.ObjectgetCorrelationId()AtomicIntegergetDeliveryAttempt()When a message-driven endpoint supports retry implicitly, this header is incremented for each delivery attempt.LonggetExpirationDate()<T> TgetHeader(String key, Class<T> type)IntegergetPriority()intgetSequenceNumber()intgetSequenceSize()<T> TgetSourceData()Get the source data header, if present.booleanisReadOnly(String headerName)voidsetReadOnlyHeaders(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 voidverifyType(String headerName, Object headerValue)Methods inherited from class org.springframework.messaging.support.MessageHeaderAccessorcopyHeaders, 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_CALLBACKA 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_DATARaw source message.- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details
- 
Method Details- 
setReadOnlyHeadersSpecify 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 for- readOnlymode. Defaults to- MessageHeaders.IDand- MessageHeaders.TIMESTAMP.
- Since:
- 4.3.2
- See Also:
- isReadOnly(String)
 
- 
getExpirationDate
- 
getCorrelationId
- 
getSequenceNumberpublic int getSequenceNumber()
- 
getSequenceSizepublic int getSequenceSize()
- 
getPriority
- 
getCloseableResourceIf the payload was created by aCloseablethat needs to remain open until the payload is consumed, the resource will be added to this header. After the payload is consumed theCloseableshould 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
 
- 
getAcknowledgmentCallbackReturn the acknowledgment callback, if present.- Returns:
- the callback.
- Since:
- 5.0.1
 
- 
getDeliveryAttemptWhen a message-driven endpoint supports retry implicitly, this header is incremented for each delivery attempt.- Returns:
- the delivery attempt.
- Since:
- 5.0.1
 
- 
getSourceDataGet the source data header, if present.- Type Parameters:
- T- the data type.
- Returns:
- the source header.
- Since:
- 5.1.6
 
- 
getHeader
- 
verifyType- Overrides:
- verifyTypein class- MessageHeaderAccessor
 
- 
isReadOnly- Overrides:
- isReadOnlyin class- MessageHeaderAccessor
 
- 
toMap- Overrides:
- toMapin class- MessageHeaderAccessor
 
 
-