TsgcWSPClient_STOMP_ActiveMQMethods › PublishEx

PublishEx Method

Sends a message to an arbitrary STOMP destination using a full ActiveMQ header collection.

Syntax

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

Parameters

NameTypeDescription
aDestinationconst StringFully-qualified ActiveMQ destination written as-is to the destination header (for example /topic/prices, /queue/orders or a composite destination).
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

Low-level publish that does not apply any prefix to aDestination and accepts the full ActiveMQ message options via aOptions. Use this when the destination is already formatted (for example composite destinations, virtual topics or advisory channels) or when the richer JMS header semantics of TsgcWSActiveMQSTOMP_Message_Options are required.

Example

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

Back to Methods