Skip to content

Core Concepts

This section introduces the fundamental communication models supported by ServiceBus.Core.


Publisher / Subscriber Model

The most common messaging scenario is asynchronous publish/subscribe communication.

graph LR

    Publisher["IAsyncPublisher"]

    Broker["Message Broker"]

    Subscriber["IAsyncSubscriber<T>"]

    Publisher --> Broker

    Broker --> Subscriber

The publisher is responsible for sending messages.

The subscriber receives and processes messages.

The broker acts as an intermediary between producers and consumers.

The core contracts remain provider agnostic.


Routing Bridge Model

Some scenarios require messages to be republished or redirected.

graph LR

    Source --> RoutingBridge

    RoutingBridge --> DestinationA

    RoutingBridge --> DestinationB

Routing bridges provide a mechanism for forwarding messages while keeping routing rules centralized.

Typical use cases include:

  • integration platforms;
  • message replication;
  • environment forwarding;
  • audit pipelines.

RPC Communication Model

ServiceBus.AspNetCore.Rabbit introduces request/response communication over RabbitMQ.

graph LR

    Publisher["IAsyncRestPublisher"]

    Broker["RabbitMQ"]

    Subscriber["IRestHostSubscriber"]

    Publisher --> Broker

    Broker --> Subscriber

Unlike traditional HTTP communication, the transport layer remains asynchronous while the application experiences a request/response interaction pattern.


Runtime Architecture

At runtime, publishers and subscribers operate through a combination of contracts, descriptors, formatters and transport implementations.

graph TD

    Descriptor

    Formatter

    Publisher

    Subscriber

    RabbitMQ

    Descriptor --> Publisher
    Descriptor --> Subscriber

    Formatter --> Publisher
    Formatter --> Subscriber

    Publisher --> RabbitMQ
    Subscriber --> RabbitMQ

This separation of responsibilities is one of the core design goals of the framework.