Skip to content

ChronicleOptions Reference

ChronicleOptions is the root configuration class for all Chronicle .NET clients. All properties can be set in code via the configureOptions callback on AddCratisChronicle, and most can be bound directly from appsettings.json under the Cratis:Chronicle section.

There are three options classes that form an inheritance chain, each adding settings relevant to its hosting context:

ClassUsed byAdds
ChronicleOptionsAll clientsConnection, serialization, timeouts, TLS, auth
ChronicleClientOptionsWorker services, console appsEvent store name, namespace resolver type
ChronicleAspNetCoreOptionsASP.NET Core appsHTTP header–based namespace resolution

All bindable settings live under Cratis:Chronicle:

{
"Cratis": {
"Chronicle": {
"ConnectionString": "chronicle://localhost:35000",
"EventStore": "my-store",
"EnableEventTypeGenerationValidation": false,
"DefaultSinkTypeId": "f7d3a1e2-4b5c-4d6e-8f9a-0b1c2d3e4f5a",
"ConnectTimeout": 5,
"AutoDiscoverAndRegister": true,
"MaxReceiveMessageSize": 104857600,
"MaxSendMessageSize": 104857600,
"ManagementPort": 8080,
"ProgramIdentifier": "my-app",
"ClaimsBasedNamespaceResolverClaimType": "tenant_id",
"Tls": {
"CertificatePath": "/certs/client.pfx",
"CertificatePassword": "secret"
},
"Authentication": {
"Authority": "https://login.example.com"
}
}
}
}

Asks the Kernel to enforce strict migration chain validation when registering event types at generation 2 or higher. The value is forwarded as part of the registration request.

Typebool
Defaultfalse

Image restriction: This flag is only honoured by the development image of the Kernel. The production image always ignores it and validates unconditionally, regardless of what the client sends. This makes it impossible to accidentally skip migration chain validation in production even if the client has this flag set to false.

To opt in to strict validation during development (recommended once your event schemas are stable), set the flag to true:

builder.AddCratisChronicle(configureOptions: options =>
{
options.EnableEventTypeGenerationValidation = true;
});

In appsettings.json: "EnableEventTypeGenerationValidation": true.

See Generation Validation for the full ruleset.

The gRPC endpoint for Chronicle Server.

TypeChronicleConnectionString
DefaultDevelopment connection string (chronicle://localhost:35000 with default dev credentials)
options.ConnectionString = "chronicle://myserver:35000";

In appsettings.json: "ConnectionString": "chronicle://myserver:35000".

Timeout in seconds when establishing a connection to Chronicle Server.

Typeint
Default5

Controls whether Chronicle automatically discovers event types, projections, reactors, reducers, and other artifacts from loaded assemblies on startup.

Typebool
Defaulttrue

Set to false when using a custom IClientArtifactsProvider or when you want full manual control over what gets registered.

Controls which sink type is used when registering projections and reducers with the Kernel. Chronicle supports two built-in sink types:

ValueDescription
WellKnownSinkTypes.MongoDBStores read models in MongoDB (default)
WellKnownSinkTypes.SQLStores read models in a SQL database as JSON documents
TypeSinkTypeId
DefaultWellKnownSinkTypes.MongoDB

To use SQL as the storage backend for all read models:

builder.AddCratisChronicle(configureOptions: options =>
{
options.DefaultSinkTypeId = WellKnownSinkTypes.SQL;
});

In appsettings.json:

{ "Cratis": { "Chronicle": { "DefaultSinkTypeId": "f7d3a1e2-4b5c-4d6e-8f9a-0b1c2d3e4f5a" } } }

See Sinks for detailed guidance on storage backends.

MaxReceiveMessageSize / MaxSendMessageSize

Section titled “MaxReceiveMessageSize / MaxSendMessageSize”

Maximum gRPC message sizes in bytes. See gRPC Message Size for detailed guidance.

Typeint?
Default104857600 (100 MB)

Port used for the Management API and the well-known certificate endpoint.

Typeint
Default8080

A human-readable identifier for the running application. Included in root causation metadata to identify which program appended an event.

Typestring
Default"[N/A]"

The software version of the entry assembly, extracted from AssemblyInformationalVersion or AssemblyVersion. Included in root causation to track which build produced an event.

Typestring
DefaultResolved from the entry assembly at startup

The commit SHA of the entry assembly, extracted from the +commit part of AssemblyInformationalVersion. Included in root causation to track which commit produced an event.

Typestring
DefaultResolved from the entry assembly at startup

The JWT claim type used by ClaimsBasedNamespaceResolver when namespace resolution is configured via WithClaimsBasedNamespaceResolver.

Typestring
Default"tenant_id"

TLS certificate settings for the gRPC connection. TLS is active when both CertificatePath and CertificatePassword are set. See TLS for full details.

TypeTls
DefaultTLS disabled (no certificate configured)
Nested propertyTypeDescription
CertificatePathstring?Path to a PFX certificate file
CertificatePasswordstring?Password for the certificate file

OAuth/OIDC authority configuration. When Authority is not set, the Chronicle internal OAuth authority is used.

TypeAuthentication
DefaultInternal authority
Nested propertyTypeDescription
Authoritystring?OAuth/OIDC authority URL

ChronicleClientOptions extends ChronicleOptions and is used by worker services, console apps, and other non-web hosts via IHostApplicationBuilder.AddCratisChronicle.

The name of the event store the client connects to. Required.

TypeEventStoreName
Default(none — must be set)
{ "Cratis": { "Chronicle": { "EventStore": "my-store" } } }

The Type of the IEventStoreNamespaceResolver to use for resolving the event store namespace. When null, defaults to DefaultEventStoreNamespaceResolver at runtime, which always returns the default namespace.

TypeType?
DefaultnullDefaultEventStoreNamespaceResolver

This is a structural dependency — it resolves a type reference and cannot be meaningfully set from appsettings.json. Set it in code via the configureOptions callback or via IChronicleBuilder.

ChronicleAspNetCoreOptions extends ChronicleClientOptions and is used by ASP.NET Core applications via WebApplicationBuilder.AddCratisChronicle. It defaults EventStoreNamespaceResolverType to HttpHeaderEventStoreNamespaceResolver.

The HTTP request header used to resolve the event store namespace on a per-request basis.

Typestring
Default"x-cratis-tenant-id"
{ "Cratis": { "Chronicle": { "NamespaceHttpHeader": "x-my-tenant" } } }