Interface MessageHistoryFactory
- All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, Service, StaticService
Factory for creating
MessageHistory entries, which together form the audit trail of a single
Exchange as it passes through each node of a route.
When the message history feature is enabled on the CamelContext, Camel's
InternalProcessor calls
newMessageHistory(String, org.apache.camel.NamedNode, org.apache.camel.Exchange) at every route-node
boundary and attaches the resulting entry to the exchange's history list. This history can later be rendered (e.g.,
as part of an exception stack trace) to show exactly which EIP nodes the message visited and in what order. The
setCopyMessage(boolean) option controls whether a snapshot of the message body is captured at each step,
which is useful for debugging but adds memory overhead.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringAn optional pattern to filter which nodes to trace in this message history.booleanWhether to make a copy of the message in theMessageHistory.newMessageHistory(String routeId, NamedNode node, Exchange exchange) Creates a newMessageHistoryvoidsetCopyMessage(boolean copyMessage) Sets whether to make a copy of the message in theMessageHistory.voidsetNodePattern(@Nullable String nodePattern) An optional pattern to filter which nodes to trace in this message history.Methods inherited from interface CamelContextAware
setCamelContextMethods inherited from interface HasCamelContext
getCamelContext
-
Method Details
-
newMessageHistory
Creates a newMessageHistory- Parameters:
routeId- the route idnode- the node in the routeexchange- the current exchange- Returns:
- a new
MessageHistory
-
isCopyMessage
boolean isCopyMessage()Whether to make a copy of the message in theMessageHistory. By default this is turned off. Beware that you should not mutate or change the content on the copied message, as its purpose is as a read-only view of the message. -
setCopyMessage
void setCopyMessage(boolean copyMessage) Sets whether to make a copy of the message in theMessageHistory. By default this is turned off. Beware that you should not mutate or change the content on the copied message, as its purpose is as a read-only view of the message. -
getNodePattern
@Nullable String getNodePattern()An optional pattern to filter which nodes to trace in this message history. By default all nodes are included. To only include nodes that are Step EIPs then use the EIP shortname, eg step. You can also include multiple nodes separated by comma, eg step,wiretap,to -
setNodePattern
An optional pattern to filter which nodes to trace in this message history. By default all nodes are included. To only include nodes that are Step EIPs then use the EIP shortname, eg step. You can also include multiple nodes separated by comma, eg step,wiretap,to
-