TsgcWSPClient_STOMP_RabbitMQ › Methods › PublishTemporaryQueue
Publishes a message to a queue and sets a reply-to header pointing at a /temp-queue/name destination.
procedure PublishTemporaryQueue(const aQueue, aReplyTo, aText: String; const aContentType: String = CS_TEXT_PLAIN; const aTransaction: String = ''; const aHeaders: TStrings = nil);
| Name | Type | Description |
|---|---|---|
aQueue | const String | Target queue name (without the /queue/ prefix) where the request is published. |
aReplyTo | const String | Temporary 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. |
aText | const String | Request body to publish. |
aContentType | const String | MIME content-type sent as the content-type header. Defaults to text/plain. |
aTransaction | const String | Optional transaction identifier. When supplied, the SEND frame is buffered under the named transaction and only delivered on commit. |
aHeaders | const TStrings | Optional application headers appended to the SEND frame; each item must be formatted as name:value. |
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.
sgcRabbitMQ.SubscribeTemporaryQueue('replies', '');
sgcRabbitMQ.PublishTemporaryQueue('rpc', 'replies', '{"op":"sum","a":1,"b":2}', 'application/json');