Checkpoints
The Checkpoint implementation is used to capture the causal relationship between "pseudo-events" that occur within IPF.
The ProcessingContext contains a updatable checkpoint field that relates to a unique identifier of a given IPF processing object.
ConnectorMessageMetadata
public class ConnectorMessageMetadata {
private String messageLogId;
private Checkpoint checkpoint;
private Checkpoint previousCheckpoint;
}
The ConnectorMessage class contains an element called ConnectorMessageMetadata. This metadata element allows for certain properties to be assigned to the ConnectorMessage that is passed between Connector stages without directly influencing the message ProcessingContext.
ReceiveConnector
For a ReceiveConnector, the inbound message ProcessingContext is updated through the following Connector stages:
-
CorrelationStage
-
If the received message contains a processing context, any processing context contained in the correlation will be merged with the message context. See Context Merging documentation for further details.
-
-
MessageLoggingStage (only applies if a MessageLogger is supplied to the connector)
-
The inbound message’s ProcessingContext checkpoint is passed into the logged Message
-
If the provided MessageLogger is an instance of CheckpointAwareMessageLogger, the MessageLogEntry’s unique
messageIdis assigned to the ProcessingContextcheckpointfield.
-
The ProcessingContext is then persisted to the remainder of the Connector flow.
SendConnector
For a SendConnector, the outbound message’s ProcessingContext is updated through the following Connector stages:
-
Before any stage when the MessageDelivery instance is created
-
New
messageIdis calculated and assigned to the ConnectorMessageMetadatamessageLogIdfield. -
If the provided MessageLogger is an instance of CheckpointAwareMessageLogger, the
messageIdis assigned to the ConnectorMessageMetadatacheckpointfield. -
The checkpoint of a current SendRequest ProcessingContext is assigned to the ConnectorMessageMetadata
previousCheckpointfield. -
If the ConnectorMessageMetadata
checkpointfield is present, both ConnectorMessage ProcessingContext and target message ProcessingContext (if target message is an instance ofUpdatebleProcessingContextHolder) are updated with this value, creating a causal link between the previous IPF object and the ProcessingContext.
-
-
MessageLoggingStage (only applies if a MessageLogger is supplied to the connector)
-
ConnectorMessageMetadata
previousCheckpointis passed into the logged Message and used as a value forprocessingContext.checkpoint.
-
The ProcessingContext is then persisted to the remainder of the Connector flow.
RequestReplySendConnector
For a RequestReplySendConnector, the outbound message’s ProcessingContext may be updated depending on the provided MessageLogger instance:
-
The provided MessageLogger is an instance of CheckpointAwareMessageLogger:
-
The outbound message’s ProcessingContext is updated in line with the SendConnector functionality.
-
The target message ProcessingContext and ConnectorMessage Processing Context are updated to Checkpoint to the emitted message log.
-
The emitted message log for the request is checkpointed to the original ProcessingContext’s Checkpoint field
-
-
When the RequestReplySendConnector receives a reply.
-
A message log is emitted, checkpointed to the message log ID of the message log emitted during the request phase.
-
The ConnectorMessage Checkpoint is updated to the message log ID of the message log emitted during the response phase.
-
-
-
The provided MessageLogger is not an instance of CheckpointAwareMessageLogger or is not provided at all:
-
The ConnectorMessage ProcessingContext is not updated throughout the connector flow.
-
Both emitted message logs (if applicable) are checkpointed to the ProcessingContext Checkpoint from the initial request.
-
The ProcessingContext is then persisted to the remainder of the Connector flow.