Skip to main content

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​

Steps​

  1. 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.
});
  1. 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;
});
});
  1. Add the Inlet client core inside Reservoir(...).
client.Reservoir(reservoir =>
{
reservoir.AddInletClient();
});

This registers the projection registry, ProjectionsFeatureState, IInletStore, and IProjectionUpdateNotifier.

  1. 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.

  1. 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 fetcher
  • WithRoutePrefix(prefix) to change the HTTP projection route prefix
  1. 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 IReservoirBuilder value inside client.Reservoir(...).
  • Inlet client registrations should extend that Reservoir builder instead of calling unrelated IServiceCollection helpers.
  • SignalR configuration should be expressed inside AddInletBlazorSignalR(...).
  • Generated domain registration methods should read like Add{Domain}Client() on ClientBuilder.
  • Generated feature registration methods should still read like AddProjectionsFeature() or Add{Aggregate}AggregateFeature() on IReservoirBuilder.

Source Code​

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​