TsgcWSPClient_STOMP_ActiveMQ › Methods › PublishQueue
Publishes a message to an ActiveMQ queue.
procedure PublishQueue(const aQueue, aText: String; const aContentType: String = CS_TEXT_PLAIN; const aTransaction: String = ''; const aOptions: TsgcWSActiveMQSTOMP_Message_Options = nil);
| Name | Type | Description |
|---|---|---|
aQueue | const String | Queue name without the /queue/ prefix; the component prepends it before sending the SEND frame. |
aText | const String | Message body written verbatim to the SEND frame. |
aContentType | const String | Value of the content-type header; defaults to text/plain. Use application/json, application/octet-stream, etc. for other payloads. |
aTransaction | const String | Optional transaction id previously opened with BeginTransaction; when set the SEND is buffered on the broker until CommitTransaction. |
aOptions | const TsgcWSActiveMQSTOMP_Message_Options | Optional JMS/ActiveMQ message headers (CorrelationId, Expires, JMSXGroupID, Persistent, Priority, ReplyTo and custom entries) added to the SEND frame. |
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).
oActiveMQ.PublishQueue('orders', '{"id":42}', 'application/json');