AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/samples/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Simple RabbitMQ Transport Usage

NuGet Package:
NServiceBus.RabbitMQ 10.x
Target Version:
NServiceBus 9.x

Prerequisites

Ensure an instance of RabbitMQ is running and accessible.

Code walk-through

This sample shows basic usage of RabbitMQ as a transport for NServiceBus to connect two endpoints. The sender sends a command or publishes an event to a receiver endpoint using the RabbitMQ broker. The receiver writes to the console when the message is received.

Configuration

var endpointConfiguration = new EndpointConfiguration("Samples.RabbitMQ.SimpleSender");
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
transport.UseConventionalRoutingTopology(QueueType.Quorum);
transport.ConnectionString("host=localhost");

The username and password can be configured in the connection string. If these are not present, the connection string defaults to host=localhost;username=guest;password=guest.

Related Articles

  • Connection settings
    The various ways to customize the RabbitMQ transport.
  • RabbitMQ Transport
    Integrate NServiceBus with RabbitMQ transport for scalable messaging and reliable distributed communication.