Interface MessageHistoryFactory

All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, Service, StaticService

public interface MessageHistoryFactory extends StaticService, CamelContextAware
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 Details

    • newMessageHistory

      MessageHistory newMessageHistory(String routeId, NamedNode node, Exchange exchange)
      Creates a new MessageHistory
      Parameters:
      routeId - the route id
      node - the node in the route
      exchange - the current exchange
      Returns:
      a new MessageHistory
    • isCopyMessage

      boolean isCopyMessage()
      Whether to make a copy of the message in the MessageHistory. 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 the MessageHistory. 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

      void setNodePattern(@Nullable String nodePattern)
      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