TsgcWSPClient_STOMP_RabbitMQ › Methods › PublishQueue
Publishes a message to a gateway-managed queue using the /queue/name prefix.
procedure PublishQueue(const aQueue, aText: String; const aContentType: String = CS_TEXT_PLAIN; const aTransaction: String = ''; const aHeaders: TStrings = nil);
| Name | Type | Description |
|---|---|---|
aQueue | const String | Queue name (without the /queue/ prefix). The component builds the final destination as /queue/aQueue. |
aText | const String | Message 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. |
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).
sgcRabbitMQ.PublishQueue('orders', 'order-42');