TsgcWSPClient_STOMP_RabbitMQMethods › PublishTemporaryQueue

PublishTemporaryQueue Method

Publishes a message to a queue and sets a reply-to header pointing at a /temp-queue/name destination.

Syntax

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

Parameters

NameTypeDescription
aQueueconst StringTarget queue name (without the /queue/ prefix) where the request is published.
aReplyToconst StringTemporary queue identifier (without the /temp-queue/ prefix) advertised to the responder; the component writes the full destination /temp-queue/aReplyTo to the reply-to header.
aTextconst StringRequest 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

Implements the request-response pattern: the request is routed to /queue/aQueue and the responder is instructed to send its reply to /temp-queue/aReplyTo. Combine with SubscribeTemporaryQueue to consume the response on the same connection.

Example

sgcRabbitMQ.SubscribeTemporaryQueue('replies', '');
sgcRabbitMQ.PublishTemporaryQueue('rpc', 'replies', '{"op":"sum","a":1,"b":2}', 'application/json');

Back to Methods