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 PostgreSQL transport usage

NuGet Package:
NServiceBus.Transport.PostgreSql 9.x
Target Version:
NServiceBus 10.x

Prerequisites

Ensure a PostgreSQL server is running and accessible. This sample connects to localhost on port 54320 using the credentials in the connection string. The database named nservicebus must exist before running the sample.

Running the sample

  1. Start both the Sender and Receiver projects.
  2. Press c to send a command, or e to publish an event, from Sender to the Receiver.
  3. The Receiver handles the message.

Code walkthrough

Configuring the PostgreSQL transport

var connectionString = "User ID=postgres;Password=mysecretpassword;Host=localhost;Port=5432;Database=nservicebus;Pooling=true;Connection Lifetime=0;Include Error Detail=true";
var routing = endpointConfiguration.UseTransport(new PostgreSqlTransport(connectionString)
{
    TransportTransactionMode = TransportTransactionMode.SendsAtomicWithReceive
});

routing.RouteToEndpoint(typeof(MyCommand), "PostgreSql.SimpleReceiver");

Related Articles