Skip to content

QueueDescriptor

QueueDescriptor describes a RabbitMQ queue.

It derives from ServiceDescriptor, so it inherits the naming model based on Prefix, Name and FullName.


Inheritance

classDiagram
    direction TB

    class ServiceDescriptor {
        +string Prefix
        +string Name
        +string FullName
    }

    class QueueDescriptor {
        +bool Durable
        +bool Exclusive
        +bool AutoDelete
        +IDictionary~string, object~ Arguments
    }

    ServiceDescriptor <|-- QueueDescriptor

Purpose

Use QueueDescriptor when a subscriber consumes from a queue.

For bound publisher topologies, use QueueBoundDescriptor, which extends the queue model with binding metadata.


Naming

QueueDescriptor uses the default prefix:

esb/queue

Example:

new QueueDescriptor
{
    Name = "orders.created"
};

The physical RabbitMQ queue name is:

esb/queue/orders.created

The provider uses FullName when declaring the queue.


Properties

Property Description
Name Logical queue name.
Prefix Queue namespace prefix.
FullName Physical RabbitMQ queue name.
Durable Indicates whether the queue survives broker restarts.
Exclusive Indicates whether the queue is exclusive to the connection.
AutoDelete Indicates whether the queue can be automatically deleted.
Arguments RabbitMQ queue declaration arguments.

Queue Arguments

RabbitMQ queue features are usually configured through Arguments.

For example, queue type is configured through:

x-queue-type

Example:

new QueueDescriptor
{
    Name = "orders.created",
    Durable = true,
    AutoDelete = false,
    Arguments =
    {
        ["x-queue-type"] = "quorum"
    }
};

Common values:

classic
quorum
stream

Runtime Behavior

graph LR

    QueueDescriptor --> FullName

    FullName --> RabbitMQQueue["RabbitMQ Queue"]

The descriptor describes the queue declaration.

The provider uses the descriptor when creating or consuming from the RabbitMQ queue.


QueueDescriptor vs QueueBoundDescriptor

QueueDescriptor describes a queue.

QueueBoundDescriptor extends queue configuration with binding metadata and is used when the queue is part of an ExchangeBoundDescriptor topology.

Use QueueBoundDescriptor inside:

new ExchangeBoundDescriptor
{
    Queues =
    {
        new QueueBoundDescriptor
        {
            Name = "orders.created"
        }
    }
};

  • ServiceDescriptor
  • QueueBoundDescriptor
  • SubscriberBoundDescriptor
  • ExchangeBoundDescriptor
  • BinderDescriptor