TsgcWSPClient_AMQPMethods › Close

Close Method

Closes the AMQP connection. Overloaded: clean close with no arguments, or explicit close passing reply-code/text/class/method.

Overloads

Overload 1

Syntax

procedure Close(aReplyCode: Word; const aReplyText: string; aFailClassId: TsgcAMQPClass = amqpClassNone; aFailMethodId: TsgcAMQPMethod = amqpMethodNone);

Parameters

NameTypeDescription
aReplyCodeWordAMQP reply-code returned to the broker (use 200 for a clean close).
aReplyTextconst stringHuman-readable reply-text returned to the broker.
aFailClassIdTsgcAMQPClassAMQP class-id of the offending method when closing after an error (amqpClassNone for a normal close).
aFailMethodIdTsgcAMQPMethodAMQP method-id of the offending method when closing after an error (amqpMethodNone for a normal close).

Remarks

Sends connection.close to the broker with the supplied reply code, reply text and optional offending class/method identifiers. Use this variant when the client has to report an error back to the broker.

Example

sgcWSPClient_AMQP1.Close(320, 'connection forced', amqpClassNone, amqpMethodNone);

Overload 2

Syntax

procedure Close;

Remarks

Parameterless overload that performs a clean shutdown (reply-code 200, reply-text "OK"). This is the usual way of terminating an AMQP session.

Example

sgcWSPClient_AMQP1.Close;

Back to Methods