TsgcWSPClient_STOMP_ActiveMQ › Methods › WriteData
Low-level write of a raw STOMP frame or stream over the WebSocket connection.
procedure WriteData(const aText: String);
| Name | Type | Description |
|---|---|---|
aText | const String | Raw text payload written as-is to the WebSocket; callers are responsible for supplying a fully-formed STOMP frame when bypassing the high-level helpers. |
Bypasses the Publish/Subscribe/ACK helpers and writes the supplied text directly to the transport. Use only when ActiveMQ requires a non-standard frame or when replaying a captured frame; no validation is performed on the content.
oActiveMQ.WriteData('SEND' + #10 + 'destination:/queue/foo' + #10 + #10 + 'hello' + #0);
procedure WriteData(aStream: TStream; aSize: Integer = 0; const aStreaming: TwsStreaming = stmNone);
| Name | Type | Description |
|---|---|---|
aStream | TStream | Source stream whose bytes are written to the WebSocket transport; position is advanced as data is read. |
aSize | Integer | Number of bytes to write; pass 0 to write from the current position to the end of the stream. |
aStreaming | const TwsStreaming | Fragmentation mode (stmNone, stmStart, stmContinue, stmEnd) used when the payload must be split across multiple WebSocket frames. |
Stream overload for sending large payloads without loading them into a string first. Useful for relaying pre-built frames or large binary bodies. The aStreaming parameter lets the caller drive a multi-frame WebSocket message manually, which is required by some ActiveMQ configurations when the payload exceeds the negotiated maximum frame size.
oStream := TFileStream.Create('frame.bin', fmOpenRead);
try
oActiveMQ.WriteData(oStream);
finally
oStream.Free;
end;