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.
When to use this
Use this guide when configuring a Blazor client that sends generated commands and consumes live projections through Inlet. Start from Spring's host setup or an application with equivalent gateway and runtime infrastructure.
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
- Configure and attach the top-level Mississippi client builder.
Keep steps 2–5 inside this single callback. UseMississippi(...) validates and attaches the completed composition when the callback returns; the client and its nested builders cannot be configured afterward.
builder.UseMississippi(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.
The generated domain method above includes AddProjectionsFeature(). That registers the generated projection reducers with the store. AddProjectionPath<T>(path) separately supports explicit mappings in IProjectionRegistry for consumers of that registry.
The SignalR fetcher has a separate DTO registry. Configure ScanProjectionDtos(...) in the next step so it can translate notification paths into DTO types and HTTP reads. Keep both registrations in the generated Spring composition.
- 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.UseMississippi(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
UseMississippi(...). - 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()onClientBuilder. - 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 UseMississippi(...), then layering Reservoir and Inlet registrations inside client.Reservoir(...). Stay with AddReservoir() only when the app is intentionally Reservoir-only.
Next Steps
- Use Generated Application Contracts for runtime, gateway, and client registration responsibilities.
- Use Keep a Workspace Projection Live to share an application-owned projection between pages.
- Use Enable DevTools for application environment selection and state inspection.
- 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.