TsgcWSPClient_STOMP_RabbitMQMethods › PublishEx

PublishEx Method

Low-level SEND to a full RabbitMQ destination string supplied by the caller.

Syntax

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

Parameters

NameTypeDescription
aDestinationconst StringRaw RabbitMQ STOMP destination, e.g. /topic/prices, /queue/orders, /amq/queue/legacy or /exchange/amq.topic/stock.eur.
aTextconst StringMessage body to publish.
aContentTypeconst StringMIME content-type sent as the content-type header. Defaults to text/plain.
aTransactionconst StringOptional transaction identifier. When supplied, the SEND frame is buffered under the named transaction and only delivered on commit.
aHeadersconst TStringsOptional application headers appended to the SEND frame; each item must be formatted as name:value.

Remarks

PublishEx is the raw counterpart of the prefix-specific helpers. Use it when the destination string is computed dynamically or points at a non-standard RabbitMQ endpoint. The component does not prepend any prefix.

Example

sgcRabbitMQ.PublishEx('/exchange/logs/info', 'service-started', 'text/plain');

Back to Methods