Interface IDataChangeHandler
Defines a handler for processing data change events for specific database tables.
public interface IDataChangeHandler : ICdcTableProvider
Properties
TableNames
Gets the names of the tables that this handler is responsible for processing.
string[] TableNames { get; }
Property Value
- string[]
The names of the tables that this handler is responsible for processing.
Remarks
Each table name corresponds to a database table that the handler can process. Table names should match the names in the CDC configuration exactly.
Methods
HandleAsync(DataChangeEvent, CancellationToken)
Processes a data change event for a specific table.
Task HandleAsync(DataChangeEvent changeEvent, CancellationToken cancellationToken)
Parameters
changeEventDataChangeEventThe DataChangeEvent representing the data change to process.
cancellationTokenCancellationTokenA token to monitor for cancellation requests. This should be observed to cancel long-running operations in a timely manner.
Returns
- Task
A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
Thrown if
changeEventisnull.- Exception
Any unexpected error during the processing of the change event should be logged and, if necessary, handled by higher-level components.