Skip to content

Build Client Dependencies

Before creating publishers and subscribers, a small set of dependencies must be constructed.

These dependencies are shared across most ServiceBus.Core components.


Required Components

The following components are required:

Component Purpose
RabbitMQ Connection Transport connectivity
Channel Message operations
IDataFormatter Serialization
Descriptor Runtime configuration
graph TD

    Connection

    Channel

    Formatter

    Descriptor

    Publisher

    Subscriber

    Connection --> Channel

    Channel --> Publisher
    Channel --> Subscriber

    Formatter --> Publisher
    Formatter --> Subscriber

    Descriptor --> Publisher
    Descriptor --> Subscriber

Construction Order

The recommended order is:

  1. Create connection factory.
  2. Create RabbitMQ connection.
  3. Create channel.
  4. Create formatter.
  5. Create descriptors.
  6. Create publisher or subscriber.
graph LR

    Factory --> Connection

    Connection --> Channel

    Channel --> Formatter

    Formatter --> Descriptor

    Descriptor --> Client

Client Construction Philosophy

ServiceBus.Core intentionally separates:

  • transport infrastructure;
  • serialization;
  • topology;
  • messaging operations.

This makes the framework easier to test and maintain.

The following pages explain each dependency in detail.