The interactions batch pipeline

Abstract

An overview of the interactions batch pipeline.

The interactions batch pipeline (<interactionsBatch>) was introduced in Sitecore 9.3. The following table describes the differences between the classic interactions pipeline and the batch interactions pipeline:

Feature

Classic interactions pipeline

Batch interactions pipeline

Writes data to xDB Reporting database in batches.

Yes

Yes

Reads data from the xDB in batches.

Yes

Yes

Pipeline processors iterate over a batch of interactions.

No. The processor runs once for each interaction in the batch.

Yes. The processor accepts a batch of interactions and performs logic on the entire batch.

The classic interactions pipeline is still available in Sitecore 9.3 and runs after the interactions batch pipeline. Although we recommend that you update your processors to work with the interactions batch pipeline, you are not forced to upgrade your processors immediately.

The following examples shows the interactions batch pipeline (<interactionsBatch>) and the classic interactions pipeline (<interactions>) in configuration:

<pipelines>
    <interactionsBatch>
    <!-- All batch processors -->
    <processor type="Sitecore.Analytics.Aggregation.Pipelines.InteractionsBatch.RunInteractionsPipeline, Sitecore.Analytics.Aggregation" resolve="true" />
    </interactionsBatch>
    <interactions>
    <-- All classic processors -->
    <processor type="Sitecore.Analytics.Aggregation.Pipelines.Interactions.LogAggregationInfo, Sitecore.Analytics.Aggregation" resolve="true" />
    </interactions>
    <contacts />
</pipelines>

Using the interactions batch pipeline

To use the interactions batch pipeline instead of the classic interaction aggregation pipeline, create and register a batch interaction aggregation processor.

Interactions batch pipeline arguments

The InteractionBatchAggregationPipelineArgs class represents interactions batch pipeline argument and includes data such as the current batch of interactions. The following table describes the properties of the InteractionBatchAggregationPipelineArgs class:

Argument

Type

Accessors

Description

Contexts

IEnumerable<IInteractionAggregationContext>

get

A list of IInteractionAggregationContext. Each IInteractionAggregationContext includes:

  • The context contact.

  • The context interaction.

  • The result of the aggregation process.

  • Sources available to the aggregation process, such as the xConnect and Reference Data clients.

DateTimeStrategy

IDateTimePrecisionStrategy

get

The strategy to reduce the precision of DateTime values. You can choose day, hour, or minute strategies by default.

Scope

AggregationScope

get

Defines the context in which the interaction aggregation is occurring - for example, history processing or live processing.

FailedAggregationContexts

ICollection<IInteractionAggregationContext>

get

Returns a list of IInteractionAggregationContext objects that resulted in an exception.