TsgcWSPClient_AMQPMethods › CloseChannelEx

CloseChannelEx Method

Closes an AMQP channel synchronously and returns True when the broker acknowledged the close.

Syntax

function CloseChannelEx(const aChannel: string; aReplyCode: Word = 0; const aReplyText: string = ''; aFailClassId: TsgcAMQPClass = amqpClassNone; aFailMethodId: TsgcAMQPMethod = amqpMethodNone; aTimeout: Integer = CS_AMQP_DEFAULT_TIMEOUT): Boolean;

Parameters

NameTypeDescription
aChannelconst stringName of the open AMQP channel on which the operation is issued.
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).
aTimeoutIntegerMaximum time in milliseconds to wait for the broker confirmation before returning False.

Return Value

True when the broker acknowledged the channel close within aTimeout, False otherwise. (Boolean)

Remarks

Extended synchronous variant of CloseChannel. Waits for channel.close-ok before returning or until aTimeout elapses.

Example

sgcWSPClient_AMQP1.CloseChannelEx('ch1', 200, 'OK');

Back to Methods