TsgcWSPClient_STOMP_RabbitMQMethods › SubscribeQueue

SubscribeQueue Method

Subscribes to a shared queue auto-declared by the STOMP gateway using the /queue/name prefix.

Syntax

procedure SubscribeQueue(const aQueue: String; const aDurable: Boolean = True; const aAutoDelete: Boolean = False; const aExclusive: Boolean = False; const aACK: TsgcSTOMPACK = ackAuto; const aOptions: TsgcWSRabbitMQSTOMP_Queue_Options = nil);

Parameters

NameTypeDescription
aQueueconst StringQueue name (without the /queue/ prefix). The component builds the final destination as /queue/aQueue; the STOMP gateway declares the queue on first use.
aDurableconst BooleanIf True (default), declares a durable queue that survives a broker restart.
aAutoDeleteconst BooleanIf True, the queue is deleted automatically when the last consumer disconnects.
aExclusiveconst BooleanIf True, the queue is restricted to the current connection and deleted on disconnect.
aACKconst TsgcSTOMPACKAcknowledgement mode: ackAuto, ackClient or ackClient-Individual. When not ackAuto the application must call ACK or NACK for every received message.
aOptionsconst TsgcWSRabbitMQSTOMP_Queue_OptionsOptional RabbitMQ x-arguments (MessageTTL, Expires, MaxLength, MaxLengthBytes, DeadLetterExchange, DeadLetterRoutingKey, MaxPriority). When nil the component Queue property is used.

Remarks

The /queue/name destination points at a shared queue managed by the STOMP gateway. All subscribers with the same queue name share message delivery (work-queue pattern). Use SubscribeQueueOutside to consume from a queue declared through AMQP or the management UI.

Example

sgcRabbitMQ.SubscribeQueue('orders', True, False, False, ackClient);

Back to Methods