Class ProtoDestination

Namespace
ProtoTest.Messaging
Assembly
ProtoTest.Messaging.dll

The messaging destination addressing forms. An exchange destination is the bare name the surface has always spoken: publishing sends to that exchange and awaiting binds the test's tap to it. A queue destination is queue:{name}: it names the queue itself, and an adapter whose broker owns queues consumes the queue directly instead of binding a tap - the form a dead-letter queue is read with.

public static class ProtoDestination
Inheritance
ProtoDestination
Inherited Members

Remarks

A queue destination is consumed, never declared: the queue exists through whoever owns it, the application's topology or the dead-letter bindings that feed it. Awaiting one reads the queue itself, so a queue with a live consumer, or two tests awaiting one queue, share its deliveries; prefer the exchange that feeds it when the suite runs in parallel. An adapter whose broker has no queue model refuses a queue destination with QueueUnsupported(string, string, string) instead of dropping it, so the await names the transport and the fix.

Fields

QueueScheme

The prefix that marks a destination as a queue: queue:.

public const string QueueScheme = "queue:"

Field Value

string

Methods

IsQueue(string?)

Whether destination addresses a queue.

public static bool IsQueue(string? destination)

Parameters

destination string

Returns

bool

Queue(string)

The destination that names the queue name.

public static string Queue(string name)

Parameters

name string

Returns

string

Exceptions

ArgumentException

name is null, empty or whitespace.

QueueName(string)

The queue name a queue destination carries. A destination without the queue form, or one whose name is empty, fails naming the form instead of being read as an exchange.

public static string QueueName(string destination)

Parameters

destination string

Returns

string

Exceptions

ArgumentException

destination is not a queue destination.

QueueUnsupported(string, string, string)

The error an adapter whose broker has no queue model throws for a queue destination: it names the destination, the adapter and the remedy, so the await fails with the caller's next step instead of timing out or silently dropping the destination.

public static InvalidOperationException QueueUnsupported(string destination, string brokerName, string remedy)

Parameters

destination string
brokerName string
remedy string

Returns

InvalidOperationException