How To Compose Inlet In Mississippi Client Apps
Overview
Use this page when you need to wire a Blazor client that combines the Mississippi client builder, Reservoir, Inlet client support, built-in Reservoir features, SignalR projection updates, and generated client feature registrations.
Before You Begin
- Read Reservoir Getting Started.
- Read Inlet Getting Started.
- Confirm that your application already has an
HttpClientregistration if you plan to use the automatic projection fetcher.
Steps
- Create the top-level Mississippi client builder.
This step establishes the public client root for a full Mississippi app.
builder.AddMississippiClient(client =>
{
// Additional composition steps go here.
});
- Add generated domain composition and hand-written Reservoir features.
This example uses the verified Spring client composition pattern.
client.AddMississippiSamplesSpringDomainClient();
client.Reservoir(reservoir =>
{
reservoir.AddDualEntitySelectionFeature();
reservoir.AddDemoAccountsFeature();
reservoir.AddAuthSimulationFeature();
reservoir.AddReservoirBlazorBuiltIns();
reservoir.AddReservoirDevTools(options =>
{
options.Enablement = ReservoirDevToolsEnablement.Always;
options.Name = "Spring Sample";
options.IsStrictStateRehydrationEnabled = true;
});
});
- Add the Inlet client core inside
Reservoir(...).
client.Reservoir(reservoir =>
{
reservoir.AddInletClient();
});
This registers the projection registry, ProjectionsFeatureState, IInletStore, and IProjectionUpdateNotifier.
- Configure projection-path composition.
Choose one of these patterns based on what your client code already has:
- use generated projection registrations such as
AddProjectionsFeature()when the client generator produced them - add explicit projection paths with
AddProjectionPath<T>(path)when you need a manual mapping - use
ScanProjectionDtos(...)inside the SignalR builder when you want automatic DTO discovery for fetch operations
- Add SignalR projection refresh support.
This example uses the automatic fetcher path verified in InletBlazorSignalRBuilder and the Spring sample.
client.Reservoir(reservoir =>
{
reservoir.AddInletBlazorSignalR(signalR => signalR
.WithHubPath("/hubs/inlet")
.ScanProjectionDtos(typeof(BankAccountBalanceProjectionDto).Assembly));
});
The SignalR builder also supports:
AddProjectionFetcher<TFetcher>()for a custom fetcherWithRoutePrefix(prefix)to change the HTTP projection route prefix
- Build and run the host.
await builder.Build().RunAsync();
Full Spring Client Example
This excerpt matches the current Spring sample startup shape.
builder.AddMississippiClient(client =>
{
client.AddMississippiSamplesSpringDomainClient();
client.Reservoir(reservoir =>
{
reservoir.AddDualEntitySelectionFeature();
reservoir.AddDemoAccountsFeature();
reservoir.AddAuthSimulationFeature();
reservoir.AddReservoirBlazorBuiltIns();
reservoir.AddReservoirDevTools(options =>
{
options.Enablement = ReservoirDevToolsEnablement.Always;
options.Name = "Spring Sample";
options.IsStrictStateRehydrationEnabled = true;
});
reservoir.AddInletClient();
reservoir.AddInletBlazorSignalR(signalR => signalR
.WithHubPath("/hubs/inlet")
.ScanProjectionDtos(typeof(BankAccountBalanceProjectionDto).Assembly));
});
});
Source code: Spring.Client/Program.cs
Verify The Result
- Full Mississippi client startup should begin with
AddMississippiClient(...). - Reservoir registrations should all hang off the same
IReservoirBuildervalue insideclient.Reservoir(...). - Inlet client registrations should extend that Reservoir builder instead of calling unrelated
IServiceCollectionhelpers. - SignalR configuration should be expressed inside
AddInletBlazorSignalR(...). - Generated domain registration methods should read like
Add{Domain}Client()onMississippiClientBuilder. - Generated feature registration methods should still read like
AddProjectionsFeature()orAdd{Aggregate}AggregateFeature()onIReservoirBuilder.
Source Code
- InletClientRegistrations.cs
- InletBlazorRegistrations.cs
- InletBlazorSignalRBuilder.cs
- SignalRConnectionRegistrations.cs
- CommandClientRegistrationGenerator.cs
- ProjectionClientRegistrationGenerator.cs
- SagaClientRegistrationGenerator.cs
- DomainClientRegistrationGenerator.cs
Summary
Compose Inlet in full Mississippi client apps by starting with AddMississippiClient(), then layering Reservoir and Inlet registrations inside client.Reservoir(...). Stay with AddReservoir() only when the app is intentionally Reservoir-only.
Next Steps
- Use Inlet Reference for the exact method surface.
- Use Read Models and Client Sync for the end-to-end projection delivery model.
- Use Spring Host Architecture to see the client composition in the sample application.