Create a custom processor for session end batching
From version 9.3, Sitecore processes expired sessions in batches instead of one at a time. If you extend the commitSession or submitSessionContext pipelines with additional processors, sessions are no longer necessarily submitted to xConnect the moment they expire. Therefore, we recommend that you change your custom processor to use the new service Sitecore.Analytics.XConnect.DataAccess.IXdbRuntimeContext, which provides access to a factory that creates a Sitecore.XConnect.IXdbContext, the interface of the xConnect Client API.
For information on how to set session expiration batch settings, see Configure session end batching.
To create a custom processor and then process session data in batches:
-
Extend the
commitSessionorsubmitSessionContextpipeline using a custom processor: -
Add code to handle the session data. The following is an example of how you can change the first name of the contact in the session using
IXdbRuntimeContext:
You can also use IXdbContext events to react on successful and failed saves of session batches.