TsgcWSPClient_STOMP_ActiveMQMethods › SubscribeQueue

SubscribeQueue Method

Subscribes to an ActiveMQ queue, prefixing the destination with /queue/.

Syntax

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

Parameters

NameTypeDescription
aQueueconst StringQueue name without the /queue/ prefix; the component prepends it before sending the SUBSCRIBE frame.
aDurableconst BooleanWhen True the subscription is registered as durable so ActiveMQ retains messages while the client is offline; requires a stable client-id.
aExclusiveconst BooleanWhen True requests an ActiveMQ exclusive consumer so only this client receives messages from the queue at a time.
aACKconst TsgcSTOMPACKAcknowledgement mode (ackAuto, ackClient or ackClientIndividual) used on the SUBSCRIBE frame; governs when ACK/NACK must be issued.
aOptionsconst TsgcWSActiveMQSTOMP_Queue_OptionsOptional ActiveMQ header collection (selector, prefetch-size, retroactive and custom headers) added to the SUBSCRIBE frame.

Remarks

Helper over SubscribeEx that targets an ActiveMQ queue: the destination header is built as /queue/ + aQueue. Queue semantics mean each message is delivered to a single consumer, so competing-consumer patterns are supported by subscribing multiple clients to the same queue. Use UnSubscribeQueue to cancel the subscription with the same queue name.

Example

oActiveMQ.SubscribeQueue('orders');

Back to Methods