MeshWeaver is built on a message-passing actor model. Every unit of work — data retrieval, UI rendering, workflow execution — travels as a typed message to a MessageHub, which processes it single-threaded. The result is predictable execution order, clean state isolation, and straightforward horizontal scale.

Architecture Overview

MessageHubs can be deployed across any cloud environment (Azure, AWS, on-premise) and communicate through a central message bus. Each hub owns its own queue; nothing runs concurrently inside a single hub. Message Bus (Central Router) Hub A Queue → Handler (Data) Cloud / On-Premise Hub B Queue → Handler (Layout) Cloud / On-Premise Hub C (Parent) Queue → Handler (Workflow) Child Hub (Sync) Background / Long-running Child Hub (Jobs) Cache warm / Indexing MessageHub topology: hubs communicate via a central message bus; each hub processes its queue single-threaded and may delegate to child hubs.


How It Works

1. Hub Allocation

Every MessageHub has a unique Address that the routing layer uses to deliver messages. When a hub starts it:

2. Message Processing Pipeline

Messages enter the hub's queue and are dispatched to the matching handler — one at a time, in arrival order.

flowchart LR subgraph Hub["MessageHub"] Q[Queue] --> H1[Data Handler] Q --> H2[Layout Handler] Q --> H3[Workflow Handler] end M[Message] --> Q H1 --> R[Response] H2 --> R H3 --> R
Handler Type Responsibility
Data Handlers Retrieve and modify data from connected sources
Layout Handlers Produce UI components for the Blazor front-end
Workflow Handlers Orchestrate multi-step business processes

A handler is registered as one of two delegate shapes, and neither returns a Task:

Delegate Signature Use
SyncDelivery<TMessage> IMessageDelivery (IMessageDelivery<TMessage>) Do the work inline and return the processed delivery.
AsyncDelivery<TMessage> IObservable<IMessageDelivery> (IMessageDelivery<TMessage>, CancellationToken) Return a composed observable; the turn loop subscribes it.

Handler bodies stay synchronous: do the work (or start an IObservable<T> chain and Subscribe) and return immediately — never async Task with an await on a mesh operation (it deadlocks the single-threaded turn loop; see AsynchronousCalls).

Callers consume responses reactively via hub.Observe<TResponse>(request, options?).Subscribe(...). Always Observe, never post-then-registerObserve allocates the message id and registers the response subject before posting, because a reply whose correlation id has no registered subject is silently dropped.

3. Request / Response Pattern

Every interaction follows a typed request/response contract. The caller sends a request message; the hub processes it and replies with a strongly-typed response — no shared memory, no callbacks, no locks.

sequenceDiagram participant Client participant Hub participant DataSource Client->>Hub: GetDataRequest Hub->>Hub: Queue & Process Hub->>DataSource: Query DataSource-->>Hub: Results Hub-->>Client: GetDataResponse

Key Concepts

Single-Threaded Processing

Each hub processes exactly one message at a time. This design:

Hierarchical Routing

A hub may spawn child hubs and delegate work to them. Typical uses:

Data Source Integration

Handlers connect to the appropriate backing store for the domain:

Category Examples
Analytics platforms Snowflake, Databricks
Transactional stores SQL Server, Cosmos DB
Binary / file storage Azure Blob Storage

Common Message Types

Message Purpose
GetDataRequest Retrieve data by reference
DataChangeRequest Create, update, or delete entities
SubscribeRequest Stream ongoing data changes to the caller
ClickedEvent UI interaction forwarded from the Blazor layer

Benefits at a Glance

Benefit How the model delivers it
Scalability Hubs distribute across clouds; add capacity by adding hubs
Isolation Each hub manages its own state — no cross-hub shared memory
Flexibility Any data source plugs in via a handler registration
Testability Message exchanges are explicit and easy to assert in tests
Observability Every message has a traceable path through the system
Reconnecting…
The server was updated. Reloading the page to pick up the latest version.