Class MongoDbCdcOptions
Configuration options for the MongoDB CDC processor using Change Streams.
public sealed class MongoDbCdcOptions
- Inheritance
-
MongoDbCdcOptions
- Inherited Members
Remarks
Connection properties are in Connection and change stream properties are in ChangeStream.
This follows the MongoClientSettings pattern of separating connection from change stream configuration.
Properties
BatchSize
Gets or sets the number of changes to process in a single batch.
[Range(1, 2147483647)]
public int BatchSize { get; set; }
Property Value
ChangeStream
Gets or sets the change stream options.
public MongoDbChangeStreamOptions ChangeStream { get; set; }
Property Value
- MongoDbChangeStreamOptions
The MongoDB change stream options.
CollectionNames
Gets or sets the collection names to watch for changes.
public string[] CollectionNames { get; set; }
Property Value
- string[]
Remarks
If empty, watches all collections in the database (or all collections in all databases if DatabaseName is also null).
Connection
Gets or sets the connection options.
public MongoDbConnectionOptions Connection { get; set; }
Property Value
- MongoDbConnectionOptions
The MongoDB connection options.
DatabaseName
Gets or sets the database name to watch for changes.
public string? DatabaseName { get; set; }
Property Value
Remarks
If null, watches changes across all databases.
ProcessorId
Gets or sets the unique identifier for this CDC processor instance.
[Required]
public string ProcessorId { get; set; }
Property Value
Remarks
Used for state tracking and distinguishing multiple processors.
ReconnectInterval
Gets or sets the interval between reconnection attempts after a failure.
public TimeSpan ReconnectInterval { get; set; }
Property Value
Methods
Validate()
Validates the options and throws if invalid.
public void Validate()
Exceptions
- InvalidOperationException
Thrown when required options are missing or invalid.