TsgcWSPClient_STOMP_ActiveMQ › Methods › PublishTopic
Publishes a message to an ActiveMQ topic.
procedure PublishTopic(const aTopic, aText: String; const aContentType: String = CS_TEXT_PLAIN; const aTransaction: String = ''; const aOptions: TsgcWSActiveMQSTOMP_Message_Options = nil);
| Name | Type | Description |
|---|---|---|
aTopic | const String | Topic name without the /topic/ 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 topic: the destination header is built as /topic/ + aTopic. All connected subscribers of the topic receive the message, with durable subscribers also getting messages that arrived while they were offline.
oActiveMQ.PublishTopic('prices', 'AAPL 193.42');