RestHostSubscriberBound¶
RestHostSubscriberBound is the RabbitMQ implementation of the IRestHostSubscriber contract.
It acts as the bridge between RabbitMQ and the ASP.NET Core execution pipeline.
Responsibilities¶
RestHostSubscriberBound is responsible for:
- consuming RPC requests;
- deserializing request payloads;
- building ASP.NET Core execution contexts;
- invoking the ASP.NET Core pipeline;
- collecting responses;
- publishing responses back to RabbitMQ.
graph LR
RabbitMQ
RestHostSubscriberBound
ASPNET["ASP.NET Core"]
Controller
RabbitMQ --> RestHostSubscriberBound
RestHostSubscriberBound --> ASPNET
ASPNET --> Controller
Position In The Architecture¶
graph TD
IAsyncRestPublisher
RabbitMQ
IRestHostSubscriber
RestHostSubscriberBound
ASPNET["ASP.NET Core"]
IAsyncRestPublisher --> RabbitMQ
RabbitMQ --> IRestHostSubscriber
IRestHostSubscriber --> RestHostSubscriberBound
RestHostSubscriberBound --> ASPNET
RestHostSubscriberBound is the default RabbitMQ implementation of the RPC server-side contract.
Execution Model¶
The component continuously listens for incoming request messages.
graph LR
Waiting
RequestReceived
Executing
ResponseGenerated
Waiting --> RequestReceived
RequestReceived --> Executing
Executing --> ResponseGenerated
ResponseGenerated --> Waiting
Formatter Integration¶
RestHostSubscriberBound relies on IDataFormatter.
graph LR
RabbitMQ --> Subscriber
Subscriber --> IDataFormatter
IDataFormatter --> Request
Request --> ASPNET
The formatter is responsible for converting payloads into CLR objects and serializing responses.
Descriptor Integration¶
Runtime behavior is driven by descriptors.
Typical configuration includes:
- exchange definitions;
- queue definitions;
- routing settings;
- retry configuration;
- response settings.
The descriptor hierarchy is documented in the Reference section.
Thread Safety¶
Multiple requests may be processed concurrently.
Applications should assume that:
- requests are independent;
- handlers may execute concurrently;
- shared state must be synchronized appropriately.
Relationship With ASP.NET Core¶
RestHostSubscriberBound does not replace ASP.NET Core.
Instead, it reuses the existing ASP.NET Core infrastructure and exposes it through RabbitMQ transport semantics.