RabbitMQ Getting Started¶
This section provides a practical introduction to creating RabbitMQ clients using the ServiceBus libraries.
The guides focus on the manual creation of the main client implementations and the minimum set of dependencies required to use them.
For architecture, messaging concepts and implementation details, refer to the dedicated documentation sections.
Prerequisites¶
Before creating a client, ensure that:
- a RabbitMQ broker is available;
- a RabbitMQ connection can be established;
- a formatter package has been installed and configured.
Client Families¶
All RabbitMQ clients require an IDataFormatter.
The core RabbitMQ clients are provided by:
ServiceBus.Core.Rabbit
The REST host subscriber is provided by:
ServiceBus.AspNetCore.Rabbit
because it depends on the ASP.NET Core hosting infrastructure.
graph TD
Formatter["IDataFormatter"]
Publisher["PublisherBound<br/>ServiceBus.Core.Rabbit"]
Subscriber["SubscriberBound<TData><br/>ServiceBus.Core.Rabbit"]
RestPublisher["StatelessRestPublisherBound<br/>FullDuplexRestPublisherBound<br/>ServiceBus.Core.Rabbit"]
RestSubscriber["RestHostSubscriberBound<br/>ServiceBus.AspNetCore.Rabbit"]
Formatter --> Publisher
Formatter --> Subscriber
Formatter --> RestPublisher
Formatter --> RestSubscriber
Once an IDataFormatter has been created, every client can be configured independently according to the messaging scenario.
Available Guides¶
Create Formatter¶
Shows how to:
- install a formatter package;
- create an
IDataFormatter; - choose between the available formatter implementations.
Create Publisher¶
Shows how to manually create a PublisherBound.
Topics include:
- connection creation;
- channel creation;
- publisher descriptor configuration;
- message publishing.
Create Subscriber¶
Shows how to manually create a SubscriberBound<TData>.
Topics include:
- subscriber descriptor configuration;
- message handlers;
- retry policy configuration;
- lifecycle management (
Start()/Stop()).
Create REST Publisher¶
Shows how to manually create REST publishers for request/response messaging over RabbitMQ.
The guide covers:
StatelessRestPublisherBound;FullDuplexRestPublisherBound.
Create REST Subscriber¶
Shows how to manually create a RestHostSubscriberBound.
The guide also explains how to start the subscriber through the ASP.NET Core application pipeline using:
app.UseSubscriberHost();
when the subscriber and its dependencies have been registered through dependency injection.
Next Steps¶
After completing the Getting Started guides, continue with:
- Concepts, to understand the messaging model.
- How To, for common configuration scenarios.
- Reference, for the complete API reference.