TsgcWSPClient_STOMP_ActiveMQ › Methods › Disconnect
Sends a DISCONNECT frame to gracefully shut down the ActiveMQ STOMP session.
procedure Disconnect(const aGraceful: Boolean = True);
| Name | Type | Description |
|---|---|---|
aGraceful | const Boolean | When True (default) a DISCONNECT frame with a receipt header is sent and the client waits for the broker to acknowledge before closing; when False the underlying WebSocket is simply dropped. |
A graceful DISCONNECT lets ActiveMQ guarantee that all previously sent frames have been processed before the connection is torn down, which is important when the last operation was a SEND that must not be lost. Use aGraceful := False only when an abrupt close is acceptable (for example during application shutdown after a fatal error).
oActiveMQ.Disconnect;