TsgcWSPClient_STOMP_RabbitMQMethods › PublishQueue

PublishQueue Method

Publishes a message to a gateway-managed queue using the /queue/name prefix.

Syntax

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

Parameters

NameTypeDescription
aQueueconst StringQueue name (without the /queue/ prefix). The component builds the final destination as /queue/aQueue.
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

Messages are routed through the default exchange of RabbitMQ to the shared queue aQueue auto-declared by the STOMP gateway. All active consumers of that queue compete for messages (work-queue pattern).

Example

sgcRabbitMQ.PublishQueue('orders', 'order-42');

Back to Methods