Skip to content

Subscriber Contracts

Subscriber contracts define how messages are consumed.

The framework currently exposes:

  • IAsyncSubscriber
  • IRestHostSubscriber

IAsyncSubscriber

Represents an asynchronous message consumer.

graph LR

    Publisher --> Broker

    Broker --> Subscriber["IAsyncSubscriber<T>"]

Typical responsibilities:

  • receive messages;
  • deserialize payloads;
  • execute business logic;
  • acknowledge processing.

Typical Scenarios

  • event processing;
  • workflow orchestration;
  • background services;
  • integration handlers.

IRestHostSubscriber

Represents an RPC-oriented subscriber.

graph LR

    Publisher --> RabbitMQ

    RabbitMQ --> IRestHostSubscriber

    IRestHostSubscriber --> ASPNET["ASP.NET Core"]

This abstraction allows ASP.NET Core applications to process RabbitMQ requests and generate responses.

The default implementation is documented in the ASP.NET Core Integration section.