TsgcWSPClient_STOMP_RabbitMQ › Methods › SubscribeQueue
Subscribes to a shared queue auto-declared by the STOMP gateway using the /queue/name prefix.
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);
| Name | Type | Description |
|---|---|---|
aQueue | const String | Queue name (without the /queue/ prefix). The component builds the final destination as /queue/aQueue; the STOMP gateway declares the queue on first use. |
aDurable | const Boolean | If True (default), declares a durable queue that survives a broker restart. |
aAutoDelete | const Boolean | If True, the queue is deleted automatically when the last consumer disconnects. |
aExclusive | const Boolean | If True, the queue is restricted to the current connection and deleted on disconnect. |
aACK | const TsgcSTOMPACK | Acknowledgement mode: ackAuto, ackClient or ackClient-Individual. When not ackAuto the application must call ACK or NACK for every received message. |
aOptions | const TsgcWSRabbitMQSTOMP_Queue_Options | Optional RabbitMQ x-arguments (MessageTTL, Expires, MaxLength, MaxLengthBytes, DeadLetterExchange, DeadLetterRoutingKey, MaxPriority). When nil the component Queue property is used. |
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.
sgcRabbitMQ.SubscribeQueue('orders', True, False, False, ackClient);