Interface IFirestoreCdcBuilder
Fluent builder interface for configuring Firestore CDC settings.
public interface IFirestoreCdcBuilder
Remarks
This builder configures Firestore-specific CDC options such as collection path,
processor name, batch size, and state store connections.
All methods return this for method chaining.
Methods
BindConfiguration(string)
Binds Firestore CDC source options from an IConfiguration section.
IFirestoreCdcBuilder BindConfiguration(string sectionPath)
Parameters
sectionPathstringThe configuration section path (e.g., "Cdc:Firestore").
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
Client(FirestoreDb)
Sets a pre-configured FirestoreDb client.
IFirestoreCdcBuilder Client(FirestoreDb client)
Parameters
clientFirestoreDb
Returns
ClientFactory(Func<IServiceProvider, FirestoreDb>)
Sets a factory that resolves a FirestoreDb from DI.
IFirestoreCdcBuilder ClientFactory(Func<IServiceProvider, FirestoreDb> clientFactory)
Parameters
clientFactoryFunc<IServiceProvider, FirestoreDb>
Returns
CollectionPath(string)
Sets the Firestore collection path to watch for changes.
IFirestoreCdcBuilder CollectionPath(string collectionPath)
Parameters
collectionPathstringThe collection path (e.g., "orders" or "organizations/org1/members").
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
CredentialsJson(string)
Sets the JSON content of the service account credentials.
IFirestoreCdcBuilder CredentialsJson(string credentialsJson)
Parameters
credentialsJsonstring
Returns
CredentialsPath(string)
Sets the path to the service account JSON credentials file.
IFirestoreCdcBuilder CredentialsPath(string credentialsPath)
Parameters
credentialsPathstring
Returns
EmulatorHost(string)
Sets the Firestore emulator host for local development (e.g., "localhost:8080").
IFirestoreCdcBuilder EmulatorHost(string emulatorHost)
Parameters
emulatorHoststring
Returns
MaxBatchSize(int)
Sets the maximum number of events to process per batch.
IFirestoreCdcBuilder MaxBatchSize(int maxBatchSize)
Parameters
maxBatchSizeintThe maximum batch size.
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
PollInterval(TimeSpan)
Sets the interval between checking for new changes when idle.
IFirestoreCdcBuilder PollInterval(TimeSpan interval)
Parameters
intervalTimeSpanThe poll interval.
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
ProcessorName(string)
Sets the unique processor name for this CDC instance.
IFirestoreCdcBuilder ProcessorName(string processorName)
Parameters
processorNamestringThe processor name.
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
ProjectId(string)
Sets the Google Cloud project ID.
IFirestoreCdcBuilder ProjectId(string projectId)
Parameters
projectIdstring
Returns
WithStateStore(Action<ICdcStateStoreBuilder>)
Configures a separate connection for CDC state persistence.
IFirestoreCdcBuilder WithStateStore(Action<ICdcStateStoreBuilder> configure)
Parameters
configureAction<ICdcStateStoreBuilder>An action to configure state store settings including project ID and collection.
Returns
- IFirestoreCdcBuilder
The builder for fluent chaining.
Remarks
Firestore uses project IDs instead of connection strings.
Use ConnectionString to set the project ID.
When omitted, the source FirestoreDb is used for state persistence.
Exceptions
- ArgumentNullException
Thrown when
configureis null.