TsgcWSPClient_STOMP_ActiveMQMethods › PublishQueue

PublishQueue Method

Publishes a message to an ActiveMQ queue.

Syntax

procedure PublishQueue(const aQueue, aText: String; const aContentType: String = CS_TEXT_PLAIN; const aTransaction: String = ''; const aOptions: TsgcWSActiveMQSTOMP_Message_Options = nil);

Parameters

NameTypeDescription
aQueueconst StringQueue name without the /queue/ prefix; the component prepends it before sending the SEND frame.
aTextconst StringMessage body written verbatim to the SEND frame.
aContentTypeconst StringValue of the content-type header; defaults to text/plain. Use application/json, application/octet-stream, etc. for other payloads.
aTransactionconst StringOptional transaction id previously opened with BeginTransaction; when set the SEND is buffered on the broker until CommitTransaction.
aOptionsconst TsgcWSActiveMQSTOMP_Message_OptionsOptional JMS/ActiveMQ message headers (CorrelationId, Expires, JMSXGroupID, Persistent, Priority, ReplyTo and custom entries) added to the SEND frame.

Remarks

Helper over PublishEx that targets an ActiveMQ queue: the destination header is built as /queue/ + aQueue. The message is delivered to exactly one connected consumer following ActiveMQ queue semantics; if no consumer is attached the broker stores the message until one becomes available (assuming persistent storage).

Example

oActiveMQ.PublishQueue('orders', '{"id":42}', 'application/json');

Back to Methods